views:

1773

answers:

2

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

+1  A: 

From a batch file, no. If you want to activate a window you have to use SetActiveWindow(). If you don't want to get dirty with windows programming but still want to activate windows and simple stuff like that, I highly recommend checking out Autoit. You could always call this program from your batchfile to have it do the task.

ryeguy
+1  A: 

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.

ShuggyCoUk
http://www.nirsoft.net/utils/nircmd.html
ryeguy
cheers - it's blocked on my net connection (hence the note)
ShuggyCoUk