2015-10-15 280 views
0

我想最小化除当前窗口以外的每个窗口。如何使用batch/powershell将所有当前窗口最小化

是的,是的, cmd/powershell: minimize all windows on your desktop except for current command prompt (console) or except for some particual window有一个答案,但它只适用于nircmd。但是,我希望这可以在没有nircmd.exe的设备上工作。

我该怎么做?

一个小批处理脚本会很好,虽然powershell是允许的。

+0

我会考虑ToggleDesktop API,然后选择“恢复”我自己的窗口。但是,PowerShell脚本可以控制自己的窗口来执行还原吗? –

回答

0

我用这个家伙Set-WindowStyle功能,尽量减少一切,但运行脚本的过程:

$self = [System.Diagnostics.Process]::GetCurrentProcess() 
Get-Process | ? { $_.Id -ne $self.Id } | % { 
    Set-WindowStyle -Style MINIMIZE -MainWindowHandle $_.MainWindowHandle 
} 
+0

这不起作用:( – RookieTEC9

相关问题