Jump to content

How do I restart explorer?


Recommended Posts

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... :mad2:

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

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

  • 2 years later...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...