views:

286

answers:

3

When I run e.g. ipconfig using the Run command (windows key+R), once the program has executed it immediately closes the instance of the command line interface, is there any universal parameter I can add to:

  • ipconfig
  • nslookup
  • dir
  • etc...

to ensure that the results stay printed in the console window?

+10  A: 

Use cmd with the /k switch:

cmd /k ipconfig
Blixt
In case your curious from the help doc of cmd ... the /k parameter is the opposite of the /c parameter/C Carries out the command specified by string and then terminates/K Carries out the command specified by string but remains
tschaible
+3  A: 

Or you just execute "cmd" via the Run command, which will open a DOS prompt.
If you type "ipconfig" there, the command prompt remains open.

(ok, I admit: basically it's the same like "cmd /k ipconfig")

haarrrgh
+6  A: 

There is also the ability to concatenate commands

& is used to just post multible commands in a line && will break if the last command wasn't successful

cmd /k ipconfig & pause & exit
Totonga
Cool! Thanks for the info =)
Blixt
Even better, because it immediateley exits after a key stroke.
furtelwart