fix: Remove all non-DOS 6.22 commands from batch files
Critical compatibility fixes - DOS 6.22 does not support many Windows batch file features. Removed all incompatible commands and replaced with DOS 6.22 compatible alternatives. Issues Fixed: 1. DEPLOY.BAT - Removed SET /P (interactive input) - Changed from: SET /P MACHINE=Machine name: - Changed to: SET MACHINE=%1 (command-line parameter) - Usage: DEPLOY.BAT TS-4R - DOS 6.22 does not support SET /P 2. CHECKUPD.BAT - Removed SET /A (arithmetic) and GOTO :EOF - Removed 6 instances of SET /A counter arithmetic - Replaced numeric counters with flag variables - Changed from: SET /A COMMON=COMMON+1 - Changed to: SET COMMON=FOUND - Replaced GOTO :EOF with actual labels - Changed display from counts to status messages 3. STAGE.BAT - Removed FOR /F (file parsing) - Changed from: FOR /F "skip=1 delims=" %%L IN (...) DO - Changed to: TYPE C:\AUTOEXEC.BAT >> C:\AUTOEXEC.TMP - DOS 6.22 only supports simple FOR loops Created check-dos-compatibility.ps1: - Automated scanner for DOS 6.22 incompatible commands - Checks for: SET /P, SET /A, IF /I, FOR /F, FOR /L, FOR /R, GOTO :EOF, %COMPUTERNAME%, &&, ||, START, invalid NUL usage - Scans all BAT files and reports line numbers - Essential for preventing future compatibility issues Verification: - All files maintain CRLF line terminators - All commands tested for DOS 6.22 compatibility - No SET /A, SET /P, FOR /F, GOTO :EOF remaining - CHOICE commands retained (CHOICE.COM exists in DOS 6.22) Impact: - DEPLOY.BAT now requires parameter: DEPLOY.BAT TS-4R - CHECKUPD.BAT shows "Updates available" vs exact counts - STAGE.BAT copies all AUTOEXEC lines (duplicate @ECHO OFF harmless) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -129,8 +129,8 @@ ECHO IF EXIST C:\BAT\REBOOT.BAT CALL C:\BAT\REBOOT.BAT >> C:\AUTOEXEC.TMP
|
||||
ECHO. >> C:\AUTOEXEC.TMP
|
||||
|
||||
REM Append current AUTOEXEC.BAT contents (skip first @ECHO OFF line)
|
||||
REM Use FIND to skip the first line, then append the rest
|
||||
FOR /F "skip=1 delims=" %%L IN (C:\AUTOEXEC.BAT) DO ECHO %%L >> C:\AUTOEXEC.TMP
|
||||
REM DOS 6.22: Use TYPE and redirect (simple copy preserves all lines)
|
||||
TYPE C:\AUTOEXEC.BAT >> C:\AUTOEXEC.TMP
|
||||
|
||||
REM Replace AUTOEXEC.BAT with modified version
|
||||
COPY C:\AUTOEXEC.TMP C:\AUTOEXEC.BAT >NUL
|
||||
|
||||
Reference in New Issue
Block a user