Carl479
Carl479

Reputation: 519

Custom `Pause` Output Batch

Most batch users use the pause command, especially when debugging their programs. CMD prints on the screen when the command is used: Press any key to continue.

Sometimes it gets hard to remember which sections have been past when debugging.

Can this be done?

:Part_1 (some code) pause (echos on the screen "Part_1 Debugged" :Part_2 (some code) pause (echos on the screen "Part_2 Debugged" And so on...

Upvotes: 1

Views: 90

Answers (2)

Stephan
Stephan

Reputation: 56180

echo Part1 debugged &pause

or

echo Part2 debugged &pause>nul

or

set /p =Part 1 debugged

Note: last line needs [ENTER] instead of [Any Key]

Upvotes: 6

Aacini
Aacini

Reputation: 67216

:Part_1
(some code)
set /P "=Part_1 Debugged" < NUL
pause > NUL
:Part_2
(some code)
set /P "=Part_2 Debugged" < NUL
pause > NUL

Upvotes: 2

Related Questions