Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop "explorer" process completely using PowerShell

Greeting, I'm trying to stop "explorer" process using power-shell command:

Stop-Process -ProcessName explorer -Force

the problem with that line, it will stop the process but it will run again automatically so it just restarting the process not stopping it.

Please advice me how to stop "explorer" process completely using power-shell

Regards,

like image 258
Eyla Avatar asked Dec 22 '11 22:12

Eyla


3 Answers

You can do this ( though I don't know why you wouldn't want explorer to come back):

taskkill /F /IM explorer.exe
like image 67
manojlds Avatar answered Nov 07 '22 17:11

manojlds


Set the AutoRestartShell DWord value to 0 before you kill explorer

PS> Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoRestartShell -Value 0
PS> Stop-Process -ProcessName explorer -Force
like image 40
Shay Levy Avatar answered Nov 07 '22 19:11

Shay Levy


Many years later but thanks for the quick tip.

just an FYI in case someone comes across this later like I did

In my case I don't want explorer to restart automatically because I want to reload the profile using:

Start-Process -ProcessName explorer -LoadUserProfile

OR load a new set of environment variables

Start-Process -ProcessName explorer -UseNewEnvironment

Cheers

like image 1
mreinsmith Avatar answered Nov 07 '22 19:11

mreinsmith