How to get the process id of Explorer launched from Powershell

蓝咒 提交于 2019-12-06 11:38:38

Explorer.exe will momentarily start a brand new process, but that process will die quickly, handing off its state to an existing explorer process. In general, it will not persist and add to a growing collection of processes, as most programs would.

See this in action:

"Old explorer.exe instances"
Get-Process explorer

Start-Process explorer.exe
sleep 1  # wait for this one to die

"New explorer.exe instances"
Get-Process explorer

You will see that it's the same set of explorer instances. I think this is related to the reg key HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced [SeparateProcess]

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