Stop “explorer” process completely using PowerShell

我的未来我决定 提交于 2019-12-10 12:52:15

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!