NiceBoy1234 Posted January 11, 2016 Share Posted January 11, 2016 How can I start the Window SHell Explorer after closing it with this:Run('TASKKILL /F /PID ' & ProcessExists('explorer.exe')) Link to comment Share on other sites More sharing options...
water Posted January 11, 2016 Share Posted January 11, 2016 By usingShellExecute("Explorer")But why would you want to kill the Explorer.? Couldn't you just close it? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
TheDcoder Posted January 11, 2016 Share Posted January 11, 2016 (edited) Run(@WindowsDir & '\explorer.exe')P.S Use ProcessClose instead of executing taskkill.exe Edited January 11, 2016 by TheDcoder P.S EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
NiceBoy1234 Posted January 11, 2016 Author Share Posted January 11, 2016 I got a strange behaviourRun('TASKKILL /F /PID ' & ProcessExists('explorer.exe'))Closes the explorer correctly, now I used a hotkey to start it again: HotKeySet("+!x", "start") Func start() Run(@WindowsDir & "\explorer.exe") EndFuncThis works at the first time, but when I am trying to run this a coupole times more it will not close the windows shell explorer. Link to comment Share on other sites More sharing options...
water Posted January 11, 2016 Share Posted January 11, 2016 Is this your full script? As it is now it will exit immediately. You need to insert a loop or something to keep it running. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
NiceBoy1234 Posted January 11, 2016 Author Share Posted January 11, 2016 It will only close if I push shift+alt+x or not? Link to comment Share on other sites More sharing options...
TheSaint Posted January 11, 2016 Share Posted January 11, 2016 Also, when you start Explorer.exe it takes time to finish all its processes.Are you waiting long enough?It is also possible to have more than one instance of Explorer running at the same time.I've also found using hotkeys to be slow and unreliable ... especially on repetitive use in quick succession ... probably a Windows issue. Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
NiceBoy1234 Posted January 11, 2016 Author Share Posted January 11, 2016 So I tried out a couple of things and finally changed this line:Run('TASKKILL /F /PID ' & ProcessExists('explorer.exe'))toRun('TASKKILL /F /PID explorer.exe')And it seems to work, what do you guys think of this "solution" Link to comment Share on other sites More sharing options...
TheSaint Posted January 11, 2016 Share Posted January 11, 2016 (edited) While ProcessExists("explorer.exe") ProcessClose("explorer.exe") WendThat will close every instance before continuing.Then you can restart it.EDITNot sure if you need to use not equal to zeroWhile ProcessExists("explorer.exe") <> 0 Edited January 11, 2016 by TheSaint Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
TheSaint Posted January 11, 2016 Share Posted January 11, 2016 (edited) While ProcessExists("explorer.exe") <> 0 ProcessClose("explorer.exe") Msgbox(0, "Result", @error) Wend HotKeySet("+!x", "restart") Func restart() Run(@WindowsDir & "\explorer.exe") Msgbox(0, "Restarted", @error) EndFuncAs per your issue mentioned in the Chatbox, see what the returns are. Edited January 11, 2016 by TheSaint Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now