Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Bring to front" for Windows XP command shell

Is there a command I can put into a Windows XP .bat file to bring the command shell to the front?

like image 769
Lauren Samuels Avatar asked Feb 17 '09 14:02

Lauren Samuels


2 Answers

nircmd will do this, though it involves a little scripting.

nircmd win activate "titleofwindow"

You basically need to know the title of the cmd window you are executing (you can set this via the TITLE command in windows)

thus:

TITLE %SOME_UNIQUE_VALE%
nircmd win activate %SOME_UNIQUE_VALE%

should do the trick.

Note some malware tools make use of the NirCmd executable (it requires no deployment as is very powerful) this may cause you problems.

like image 178
ShuggyCoUk Avatar answered Sep 20 '22 15:09

ShuggyCoUk


Another way to get the cmd prompt window to show in front is by ending file1.bat with a command to call a second file2.bat file, followed by an exit command.

EXAMPLE using file1.bat

....
[your code here]
start C:\file2.bat
exit

This closes file1.bat and opens a second .bat file where you can continue with your code. This second .bat command prompt will open in front of other windows

like image 32
Rodger Avatar answered Sep 21 '22 15:09

Rodger