[英]Close “This PC” using command line or Powershell on Windows 10
If I type in "explorer" in powershell, it opens "This PC". 如果我在powershell中输入“ explorer”,它将打开“ This PC”。 How can I close "This PC" using command line or powershell script?
如何使用命令行或Powershell脚本关闭“此PC”?
What are you trying to accomplish by starting 'explorer.exe' via PowerShell with no starting location? 您试图通过没有启动位置的PowerShell启动'explorer.exe'来完成什么工作?
What OS are you running? 您正在运行什么操作系统? On Win10 this opens at 'Quick Access'.
在Win10上,这将在“快速访问”处打开。
You can use PowerShell to open explorer to any directory you choose using 您可以使用PowerShell将资源管理器打开到使用以下命令选择的任何目录
Invoke-Item -path SomeQuaifiedPath
# or
ii SomeQualifiedPath
You can get the main window name of a given process, of course along with its Id and stop them by either property, using the Stop-Process cmdlet. 您当然可以获取给定进程的主窗口名称及其ID,并使用Stop-Process cmdlet通过任一属性将其停止。
Get-Process |
Where-Object -FilterScript {
$PSItem.MainWindowHandle -ne 0
} |
Select-Object -Property Name, Description, MainWindowTitle, Company, ID |
Out-GridView -Title 'Choose Application to Kill' -PassThru |
Stop-Process -Force -Confirm:$true
This works for me 这对我有用
Start-Process Explorer
$explorerID = (Get-Process Explorer).Id
Stop-Process -Id $explorerID
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.