Disable 'pause' in windows bat script

Viewed 6776

In windows, I am running a bat script that currently ends with a 'pause' and prompts for the user to 'Press any key to continue...'

I am unable to edit the file in this scenario and I need the script to terminate instead of hang waiting for input that will never come. Is there a way I can run this that will disable or circumvent the prompt?

I have tried piping in input and it does not seem to help. This script is being run from python via subprocess.Popen.

4 Answers

For me the following code works:

p = Popen("c:\script.bat <nul", cwd="c:\")
Related