Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a parameter for MSDOS commands (e.g. ipconfig) that cause them to wait for input before disappearing?

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?

like image 203
StuperUser Avatar asked Nov 28 '22 05:11

StuperUser


2 Answers

Use cmd with the /k switch:

cmd /k ipconfig
like image 68
Blixt Avatar answered Dec 05 '22 17:12

Blixt


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
like image 34
Totonga Avatar answered Dec 05 '22 17:12

Totonga