Draygoes Posted July 9, 2022 Share Posted July 9, 2022 I've tried and tried. I can kill the process, but running explorer.exe opens an explorer window, not the entire program. Even doing it via a CMD command, IN AUTOIT, doesn't work. That's not to say typing explorer.exe into CMD doesn't work. That works fine. But not in code... Oh yeah, I almost forgot to post the code. #RequireAdmin RegWrite( "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoTrayItemsDisplay", "REG_DWORD", "1") Run(@ComSpec & " /c " & 'Taskkill /f /im explorer.exe', "", @SW_HIDE) Do Sleep( 100 ) Until Not ProcessExists( "explorer.exe" ) MsgBox(0, "Success", "Explorer has now been closed." ) Run(@ComSpec & " /c " & 'explorer.exe', "", @SW_HIDE) Run("explorer.exe") Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist. Link to comment Share on other sites More sharing options...
Draygoes Posted July 9, 2022 Author Share Posted July 9, 2022 Both Run(@ComSpec & " /c " & 'explorer.exe', "", @SW_HIDE) Run("explorer.exe") have the same result. The both open an explorer window. Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist. Link to comment Share on other sites More sharing options...
Subz Posted July 9, 2022 Share Posted July 9, 2022 You need to use 64-bit compiled script: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Local $sExplorer = "explorer.exe" While ProcessExists($sExplorer) ProcessClose($sExplorer) WEnd Run($sExplorer) SkysLastChance 1 Link to comment Share on other sites More sharing options...
PixelPixPanreyes Posted September 12 Share Posted September 12 This snippet also restarts it: Local $Kernel32 = DllOpen("kernel32.dll") Local $hproc = DllCall($Kernel32, 'int', 'OpenProcess', 'int', 0x1F0FFF, 'int', True, 'int', ProcessExists('explorer.exe')) DllCall($Kernel32, "int", "TerminateProcess", "int", $hproc[0], "dword", 0) DllClose($Kernel32) I got it from another thread, but because this thread is newer the other is a bit more hidden. I use it to refresh the icon layout after doing a RegDelete("HKCU64\Software\Microsoft\Windows\Shell\Bags\1\Desktop","IconLayouts") 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