CMD / PowerShell的:减少除了当前命令提示符(控制台),或者除了一些particual窗口在桌面上的所有窗口 [英] cmd / powershell: minimize all windows on your desktop except for current command prompt (console) or except for some particual window

查看:316
本文介绍了CMD / PowerShell的:减少除了当前命令提示符(控制台),或者除了一些particual窗口在桌面上的所有窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好了,我知道如何使用PowerShell的方法,以尽量减少从一个批处理文件在桌面上所有打开的窗口 - MinimizeAll():

well, I know how to minimize all open windows on the desktop from a batch file by using powershell method - MinimizeAll():

powershell -command "& { $x = New-Object -ComObject Shell.Application; $x.minimizeall() }"

问题是:这种方法最大限度地减少一切,包括当前CMD控制台应该是在我的情况始终对用户可见

the problem is: this method minimizes everything including current cmd-console which should be in my case always visible to the user.

现在,要解决这个问题,我使用外部 nircmd.exe 工具及本部我.BAT文件看起来是这样的:

now, to workaround this problem I use external nircmd.exe tool and this part of my .bat-file looks like this:

:: change current command prompt window title
title my-cmd-console

:: minimize all open windows on the desktop with powershell command
powershell -command "& { $x = New-Object -ComObject Shell.Application; $x.minimizeall()  }"

:: bring console back to the front with nircmd.exe command 'win activate [filter window by title]' 
nircmd.exe win activate title "my-cmd-console" 

我不喜欢这个code是有在屏幕上多闪蒸:在启动时,控制台出现在桌面上,那么它就会与所有其他窗口最小化,然后它带回桌面上的再次正面。

what I don't like about this code is that there is much 'flashing' on the screen: at start, the console appears on the desktop, then it gets minimized with all other windows and then it's brought back on the desktop front again.

所以,问题是:如何让控制台出现在桌面前,锁定,因此,它永远不会淡出人们的视线,直到到达命令行退出

so, the question is: how to make console appear on the desktop front and 'lock it', so that it never gets out of sight until the command line EXIT is reached.

P.S。
不知道,但也许有另一种解决方案,以最小化所有,除了特定的窗口的问题,而无需使用外部的 nircmd.exe 工具。任何想法?

P.S. not sure, but maybe there is an alternative solution to 'minimize all except for particular window' problem without need to use external nircmd.exe tool. any ideas?

推荐答案

最小化所有,但活动窗口(切换命令):

minimize all but the active window (toggling command):

nircmd sendkeypress rwin+home 

这篇关于CMD / PowerShell的:减少除了当前命令提示符(控制台),或者除了一些particual窗口在桌面上的所有窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆