voovode Posted March 24, 2010 Share Posted March 24, 2010 Hey guys, i've been trying to pause a batch file like to show "press any key to continue" and then to execute the following lines but unluckily this doesn't work in W7. You can try it by yourself if you want: @echo off echo. pause ipconfig /all Any solutions? It's midnight and i can't think atm Hehehh. Link to comment https://www.neowin.net/forum/topic/886092-pause-command-in-bat-files/ Share on other sites More sharing options...
yxz Posted March 24, 2010 Share Posted March 24, 2010 Link to comment https://www.neowin.net/forum/topic/886092-pause-command-in-bat-files/#findComment-592386052 Share on other sites More sharing options...
JohnG86 Posted March 24, 2010 Share Posted March 24, 2010 Works as expected under Windows 7 64bit. I think you should have it like this: @echo off echo. ipconfig /all pause With the pause above ipconfig/all, press enter and ipconfig/all will roll through then vanish. This way it stops after running the command. Link to comment https://www.neowin.net/forum/topic/886092-pause-command-in-bat-files/#findComment-592386078 Share on other sites More sharing options...
voovode Posted March 24, 2010 Author Share Posted March 24, 2010 I want to ask first before executing ipconfig /all .... i forgot to mention. Link to comment https://www.neowin.net/forum/topic/886092-pause-command-in-bat-files/#findComment-592386220 Share on other sites More sharing options...
Eric Veteran Posted March 24, 2010 Veteran Share Posted March 24, 2010 There didn't used to be a way to do that. There's an executable called "YN.COM" that we used to use that would let you put yes/no queries in DOS batch files. You can use "CHOICE.COM" that comes with Windows. http://www.robvanderwoude.com/choice.php Link to comment https://www.neowin.net/forum/topic/886092-pause-command-in-bat-files/#findComment-592386248 Share on other sites More sharing options...
voovode Posted March 24, 2010 Author Share Posted March 24, 2010 If you try @echo off echo. &pause ipconfig /all &pause under WindowsXP, you'll see that it's working: It asks for a key before execuiting ipconfig /all. Link to comment https://www.neowin.net/forum/topic/886092-pause-command-in-bat-files/#findComment-592386256 Share on other sites More sharing options...
yxz Posted March 24, 2010 Share Posted March 24, 2010 @echo off echo. pause ipconfig /all pause works under windows 7 Link to comment https://www.neowin.net/forum/topic/886092-pause-command-in-bat-files/#findComment-592386274 Share on other sites More sharing options...
voovode Posted March 24, 2010 Author Share Posted March 24, 2010 Everytime i hit a button, i end up getting "Press any key to continue...", like a loop.. So...? It doesn't work for me. Link to comment https://www.neowin.net/forum/topic/886092-pause-command-in-bat-files/#findComment-592386282 Share on other sites More sharing options...
Singh400 Posted March 25, 2010 Share Posted March 25, 2010 On 24/03/2010 at 00:26, voovode said: @echo offecho. pause ipconfig /all That is the correct way, I suggest running the bat file as Administrator. See what happens. Link to comment https://www.neowin.net/forum/topic/886092-pause-command-in-bat-files/#findComment-592392568 Share on other sites More sharing options...
voovode Posted March 25, 2010 Author Share Posted March 25, 2010 it does nothing for me :x, always ends with "press any key" Link to comment https://www.neowin.net/forum/topic/886092-pause-command-in-bat-files/#findComment-592395120 Share on other sites More sharing options...
aniv Posted March 25, 2010 Share Posted March 25, 2010 On 24/03/2010 at 00:44, JohnG86 said: Works as expected under Windows 7 64bit. I think you should have it like this: @echo off echo. ipconfig /all pause With the pause above ipconfig/all, press enter and ipconfig/all will roll through then vanish. This way it stops after running the command. Works! Link to comment https://www.neowin.net/forum/topic/886092-pause-command-in-bat-files/#findComment-592395162 Share on other sites More sharing options...
Recommended Posts