fix: Replace PAUSE with message syntax (not supported in DOS 6.22)

Issue: DOS 6.22 PAUSE command does not accept message text as parameter.
The syntax "PAUSE message..." is a Windows NT/2000+ feature that causes
command-line parameters (%1, %2, etc.) to be consumed/lost in DOS 6.22.

Root cause: User ran "T:\DEPLOY.BAT TS-4R" but script reported
"Machine name not provided". The parameter %1 was being consumed by
the invalid PAUSE syntax at line 31 before reaching GET_MACHINE_NAME.

Changes:
- Fixed 46 PAUSE commands across 9 BAT files
- Converted "PAUSE message..." to "ECHO message..." + "PAUSE"
- Updated check-dos-compatibility.ps1 to detect PAUSE with message
- Created fix-pause-syntax.ps1 automated fix script

Example fix:
BEFORE (Windows NT+ syntax, causes parameter loss):
  PAUSE Press any key to continue...

AFTER (DOS 6.22 compatible):
  ECHO Press any key to continue...
  PAUSE

DOS 6.22 PAUSE command:
- Syntax: PAUSE (no parameters)
- Displays: "Press any key to continue..."
- Cannot customize message (built-in text only)

Files modified:
- DEPLOY.BAT: 10 PAUSE commands fixed
- UPDATE.BAT: 7 PAUSE commands fixed
- CTONW.BAT: 8 PAUSE commands fixed
- NWTOC.BAT: 6 PAUSE commands fixed
- REBOOT.BAT: 4 PAUSE commands fixed
- STAGE.BAT: 6 PAUSE commands fixed
- CHECKUPD.BAT: 2 PAUSE commands fixed
- DOSTEST.BAT: 2 PAUSE commands fixed
- AUTOEXEC.BAT: 1 PAUSE command fixed

Deployed to:
- D2TESTNAS: /data/test/*.BAT (9,908 bytes for DEPLOY.BAT)

Testing: Should now correctly receive command-line parameter:
  T:\DEPLOY.BAT TS-4R

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-19 17:19:44 -07:00
parent e040cc99ff
commit 3b55cf1312
11 changed files with 154 additions and 46 deletions

View File

@@ -29,6 +29,7 @@ $IncompatiblePatterns = @(
@{Pattern='XCOPY.*\/Q'; Description='XCOPY /Q (quiet mode) - NOT in DOS 6.22'},
@{Pattern='IF.*\('; Description='IF ( ... ) multi-line blocks - NOT in DOS 6.22 (use GOTO labels)'},
@{Pattern='\)\s*ELSE\s*\('; Description=') ELSE ( clause - NOT in DOS 6.22 (use GOTO labels)'},
@{Pattern='^PAUSE\s+'; Description='PAUSE message - NOT in DOS 6.22 (use ECHO then PAUSE)'},
@{Pattern='CHOICE\s+/[A-Z]'; Description='CHOICE with options - Check if CHOICE.COM available'},
@{Pattern='START\s+'; Description='START command - NOT in DOS 6.22'}
)