dr3amer Posted May 15, 2018 Posted May 15, 2018 Hi guys, I'm using this script to restart explorer.exe #include <WinAPI.au3> #include <WinAPISys.au3> ;Save icon positions (probably not needed since we are doing a graceful exit ..) DllCall("shell32.dll", "none", "SHChangeNotify", "long", 0x8000000, "uint", BitOR(0x0, 0x1000), "ptr", 0, "ptr", 0) ;Close the explorer shell gracefully $hSysTray_Handle = _WinAPI_FindWindow('Shell_TrayWnd', '') _SendMessage($hSysTray_Handle, 0x5B4, 0, 0) While WinExists($hSysTray_Handle) Sleep(500) WEnd _start_explorer() While Not _WinAPI_GetShellWindow() Sleep(500) WEnd EnvUpdate() ; continue script Exit Func _start_explorer() $strComputer = "localhost" $objWMI = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") Local $objexplorer = $objWMI.Get("win32_process") $objexplorer.create("explorer.exe") EndFunc ;==>_start_explorer thanks to user Deye Is there a way to recover whatever previously open explorer window? Thanks!
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