There are a number of console type applications, e.g. ipconfig, that output information to the standard output.

The problem is that if I create a windows shortcut to them it runs the command and closes the console window before I can read the output.

I realize that I could create a batch file with a pause command and then make the shortcut go to that batch file, but I was wondering if there was any generic way I could configure a shortcut to a console/command-line type program to leave the window open until the user explicitly closes it.

link|improve this question

feedback

3 Answers

up vote 3 down vote accepted

Use cmd.exe

cmd /k ipconfig
cmd /k ping google.com
cmd /k etc..........

command line does NOT go away until you exit it.

link|improve this answer
Tough to pick a winner on this one because all of these answers work, but I'm going with this one because it is the simplest of the approaches offered. – JohnFx Aug 13 '10 at 15:26
Great Answer. Thank you. – Radek Jul 26 '11 at 1:24
feedback

Probably you can't. I thought there was an option to set, but on Windows Seven, I cannot find anything like this.

Like you said, the easiest way is to make a batch file. Note that you can make it perfectly generic. Create a file generic.bat containing:

%1
pause

then call it with a shortcut:

generic.bat ipconfig
link|improve this answer
That's a really good idea! – JohnFx Aug 13 '10 at 15:24
feedback

Alternatively, you can use the /c option with cmd.exe like so:

%COMSPEC% /c ipconfig&&pause
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.