问题
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,
回答1:
You can do this ( though I don't know why you wouldn't want explorer to come back):
taskkill /F /IM explorer.exe
回答2:
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
回答3:
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
来源:https://stackoverflow.com/questions/8610318/stop-explorer-process-completely-using-powershell