9

I am writing a batch script. After a stage in the command window it says 'press any key to continue' and halts, and after something is pressed the script continues. How can I prevent this in the script?

AakashM
  • 62,551
  • 17
  • 151
  • 186
Venu
  • 91
  • 1
  • 1
  • 3
  • 2
    Could we see the source code ? :/ – ykatchou Dec 29 '10 at 08:49
  • 2
    This question doesn't specify if you want to avoid the text or the stopping of the script. @Silly's answer will hide the text, @user1066231's answer will cause the script will not stop and wait. This could actually also be achieved by `pausenul` but has different result – papo May 13 '18 at 20:34

3 Answers3

9

That's the output of the PAUSE command:

http://ss64.com/nt/pause.html

The problem with PAUSE is that it's often necessary when you run a batch file from Windows explorer (or you cannot read the output) but it's annoying in the command prompt. I asked about it here and I was suggested a nifty trick:

Conditional PAUSE (not in command line)

Community
  • 1
  • 1
Álvaro González
  • 142,137
  • 41
  • 261
  • 360
8

Pause>nul Will make it not echo 'press any key to continue . . .'

Silly
  • 217
  • 5
  • 9
2

you can call other script like this from source, @echo | call otherScript.bat please find the detailed answer here Another thread with example

user1066231
  • 551
  • 1
  • 7
  • 27