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:
18
STAGE.BAT
18
STAGE.BAT
@@ -169,7 +169,8 @@ ECHO 4. Restore C:\AUTOEXEC.BAT from C:\AUTOEXEC.SAV
|
||||
ECHO.
|
||||
ECHO ==============================================================
|
||||
ECHO.
|
||||
PAUSE Press any key to return to DOS...
|
||||
ECHO Press any key to return to DOS...
|
||||
PAUSE
|
||||
GOTO END
|
||||
|
||||
REM ==================================================================
|
||||
@@ -186,7 +187,8 @@ ECHO C:\CONFIG.NEW (not found)
|
||||
ECHO.
|
||||
ECHO Run NWTOC to download updates from network.
|
||||
ECHO.
|
||||
PAUSE Press any key to exit...
|
||||
ECHO Press any key to exit...
|
||||
PAUSE
|
||||
GOTO END
|
||||
|
||||
:NO_AUTOEXEC
|
||||
@@ -195,7 +197,8 @@ ECHO [ERROR] C:\AUTOEXEC.BAT not found
|
||||
ECHO.
|
||||
ECHO Cannot stage updates without existing AUTOEXEC.BAT
|
||||
ECHO.
|
||||
PAUSE Press any key to exit...
|
||||
ECHO Press any key to exit...
|
||||
PAUSE
|
||||
GOTO END
|
||||
|
||||
:BACKUP_ERROR
|
||||
@@ -208,7 +211,8 @@ ECHO Check:
|
||||
ECHO - Sufficient disk space on C:
|
||||
ECHO - C: drive is not write-protected
|
||||
ECHO.
|
||||
PAUSE Press any key to exit...
|
||||
ECHO Press any key to exit...
|
||||
PAUSE
|
||||
GOTO END
|
||||
|
||||
:CREATE_ERROR
|
||||
@@ -220,7 +224,8 @@ ECHO - C:\BAT directory exists
|
||||
ECHO - Sufficient disk space on C:
|
||||
ECHO - C: drive is not write-protected
|
||||
ECHO.
|
||||
PAUSE Press any key to exit...
|
||||
ECHO Press any key to exit...
|
||||
PAUSE
|
||||
GOTO END
|
||||
|
||||
:MODIFY_ERROR
|
||||
@@ -232,7 +237,8 @@ ECHO.
|
||||
ECHO Recovery:
|
||||
ECHO COPY C:\AUTOEXEC.SAV C:\AUTOEXEC.BAT
|
||||
ECHO.
|
||||
PAUSE Press any key to exit...
|
||||
ECHO Press any key to exit...
|
||||
PAUSE
|
||||
GOTO END
|
||||
|
||||
REM ==================================================================
|
||||
|
||||
Reference in New Issue
Block a user