Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppressing windows command line PAUSE command

I have been tasked with consolidating out entire teams' build process. Including build servers, CI, etc.

The way our project is structured is that each sub team is responsible for the development of their own code bases.

Over time, each team has usually created their own python/sh/bat/Wix depending on the requirements of their deployment. I've been tasked with consolidating all the builds into one primary Team City system.

Problem is that I've found that many build scripts (bat files) contain commands such as UI prompting and PAUSEing.

Does anybody know of any way to perhaps suppress those commands prior/during the script execution.

I have considered preprocessing the batch files and removing/REM'ing the Pauses but that is not ideal. Since there are +- 350 individual projects spread across +- 35 HG repositories (which are, in themselves, spread across 4 cities).

Ideally we don't want to perform pre-building cleanup.

Does anyone know of any supper-dupper magic trick to do this or does it required making changes to each build file,

like image 584
Tal Even-Tov Avatar asked Apr 20 '26 21:04

Tal Even-Tov


1 Answers

You can disable input by redirecting input to nul: <nul yourScrpt.bat. This will effectively disable any PAUSE commands, but it will also disable any SET /P or other command that prompts for input.

If you disable input for a master bat script that calls other scripts, the child scripts will inherit the disabled input.

like image 146
dbenham Avatar answered Apr 23 '26 21:04

dbenham



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!