Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Restart Explorer (the official way)


  • Please log in to reply
7 replies to this topic
chaz
  • Members
  • 192 posts
  • Last active: Oct 01 2015 02:42 AM
  • Joined: 26 Mar 2013
I know this script is simple, but it's a lot more handy than killing explorer in Task Manager (which isn't the official way and won't save some changes like taskbar autohide) or Ctrl+Shift right-clicking in the Start Menu and clicking Exit Explorer, then restarting explorer in task manager.

Edit: Doesn't seem to work as expected. Anyone have a properly working solution?
^!#E::     ; ctrl+windows+alt+e
	WinGet, h, ID, ahk_class Progman	        ; use ahk_class WorkerW for XP
	PostMessage, 0x12, 0, 0, , ahk_id %h%	;wm_quit
	sleep, 25
	Run, "%windir%\explorer.exe"
	return

Find me at the other forum as timeFlies.


SnowFlake_FlowSnake
  • Members
  • 845 posts
  • Last active: Jan 24 2016 05:24 PM
  • Joined: 08 Oct 2012

nice this program will come in handy tnx :D


  • Download link of my scripts on Autohotkey.com 2/10/2015 [DOWNLAND]
  • Contact Info:  https://github.com/floowsnaake //  FloowSnaake(A)gmail.com
  • IF you need Help send me a PM,Email or Post on Github

  • Quote by tank  Posted 29 September 2015 - 06:14 PM

  • "Eventually i will find a way to convert the DB back to PHPBB3. but i dont have the bandwidth right now. No one that has tried has had success. It is the Only way i can keep this open is if i could successfully convert it."

Cragaha
  • Members
  • 265 posts
  • Last active: Jan 04 2016 02:24 AM
  • Joined: 19 Nov 2010

Nice chaz,

I think its A_WinDir and not WinDir.

Also it doesn't seem to work on 7, taskbar disappears and reappears again, while open explorer windows stay opened.



chaz
  • Members
  • 192 posts
  • Last active: Oct 01 2015 02:42 AM
  • Joined: 26 Mar 2013

Open explorer windows stay open probably because you have set in folder options "Launch folder windows in a separate process" so it's restarting just the shell and not open windows. And you're right, it is A_WinDir and it normally wouldn't be necessary to include that part because explorer is a common exe that doesn't need a path, but when I ran just "explorer.exe" a new explorer window would open instead of restarting the shell, but "windir" seemed to work so I just left it.

 

I don't recall where I got this from, but it was originally this and it worked fine on my old 32-bit win7 PC:

^!#E::
WinGet, h, ID, ahk_class WorkerW
PostMessage, 0x12, 0, 0, , ahk_id %h%	;wm_quit
sleep, 25
Run, explorer.EXE
return

but it quit working when I moved to my new 64-bit win7 PC.


Find me at the other forum as timeFlies.


A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

This simple piece works fine for me..

#e::
Process,close,explorer.exe
sleep, 5000 ;This sleep 5000 is to let you see what actually happens. Decrease it later
run, explorer.exe
return

Alternatively adding this after Run, explorer.exe , makes it even better

WinWait, ahk_class CabinetWClass
WinClose ;close the new explorer window

Tested in Win 7 32


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


chaz
  • Members
  • 192 posts
  • Last active: Oct 01 2015 02:42 AM
  • Joined: 26 Mar 2013

Yes, I knew I could do that A v I, but the whole point of this script was to restart explorer without killing the process, but instead do it cleanly, like when you ctrl+shift+right click in the start menu and click Exit Explorer, or hold ctrl+alt+shift while pressing Cancel in the Shut Down dialogue (press Alt+F4 when the taskbar or desktop is active to open the Shut Down dialogue).


Find me at the other forum as timeFlies.


mikeoertli
  • Members
  • 1 posts
  • Last active: Jul 17 2013 08:04 PM
  • Joined: 17 Jul 2013

This works for me. It clicks the start icon, then shift+control clicks and clicks Exit Explorer, then restarts explorer. All my windows remain open.

 

I'm running 64 bit windows 7 professional.

 

    WinWait, Start, 
    IfWinNotActive, Start, , WinActivate, Start, 
    WinWaitActive, Start, 
    MouseClick, left,  23,  36
    Sleep, 100
    WinWait, Start menu, 
    IfWinNotActive, Start menu, , WinActivate, Start menu, 
    WinWaitActive, Start menu, 
    Send, {CTRLDOWN}{SHIFTDOWN}
    MouseClick, right,  384,  428
    Sleep, 100
    Send, {CTRLUP}{SHIFTUP}
    MouseClick, left,  422,  412
    Sleep, 1000
    run, explorer.exe


ZoltanZen
  • Members
  • 1 posts
  • Last active: Jun 03 2015 02:25 PM
  • Joined: 01 Jun 2015
run, taskkill /f /im explorer.exe
sleep, 5000
run, explorer.exe