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>
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>
Critical fix for DOS 6.22 compatibility - NUL is a reserved device name
in both DOS and Windows and cannot be used as a file/directory name.
Problem:
- "T: 2>NUL" attempts to create a file called "NUL" (not allowed)
- "IF NOT EXIST T:\NUL" tests for NUL device (unreliable)
- "IF NOT EXIST path\NUL" treats NUL as filename (invalid)
Solution - Replaced with proper DOS 6.22 tests:
- "T: 2>NUL" → "DIR T:\ >nul" (test drive access via directory listing)
- "IF NOT EXIST T:\NUL" → "IF NOT EXIST T:\*.*" (test for any files)
- "IF NOT EXIST path\NUL" → "IF NOT EXIST path\*.*" (test directory)
Note: Using lowercase "nul" for output redirection is acceptable as
it redirects to the NUL device, but NUL as a filename/path is invalid.
Files updated:
- DEPLOY.BAT: Fixed drive and directory tests
- UPDATE.BAT: Fixed drive and directory tests
- NWTOC.BAT: Fixed drive and directory tests
- CTONW.BAT: Fixed drive and directory tests
- CHECKUPD.BAT: Fixed drive and directory tests
- DOSTEST.BAT: Fixed drive and directory tests
Created fix-nul-references.ps1:
- Automated script to find and fix NUL references
- Preserves CRLF line endings
- Updates all BAT files consistently
Created monitoring scripts:
- monitor-sync-status.ps1: Periodic sync monitoring
- quick-sync-check.ps1: Quick AD2-to-NAS sync status check
Verification:
- All BAT files maintain CRLF line terminators
- File sizes increased slightly (4-8 bytes) due to pattern changes
- DOS 6.22 compatible wildcard tests (*.*) used throughout
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implemented comprehensive DOS 6.22 update system for ~30 test stations with
critical fix for test data database import routing.
## Major Changes
### DOS Batch Files (7 files)
- NWTOC.BAT: Download updates from network to DOS machines
- CTONW.BAT v1.2: Upload with separate ProdSW/LOGS routing (CRITICAL FIX)
- UPDATE.BAT: Full system backup to network
- STAGE.BAT: System file staging for safe updates
- REBOOT.BAT: Apply staged updates on reboot
- CHECKUPD.BAT: Check for available updates
- DEPLOY.BAT: One-time deployment installer for DOS machines
### CTONW v1.2 Critical Fix
Fixed test data routing to match AD2 sync script expectations:
- Software distribution: C:\ATE\*.EXE -> T:\TS-4R\ProdSW\ (bidirectional)
- Test data logging: C:\ATE\8BDATA\*.DAT -> T:\TS-4R\LOGS\8BLOG\ (upload only)
- Subdirectory mapping: 8BDATA->8BLOG, DSCDATA->DSCLOG, HVDATA->HVLOG, etc.
- Test data now correctly imported to AD2 database via Sync-FromNAS.ps1
### Deployment Infrastructure
- copy-to-ad2.ps1: Automated deployment to AD2 server
- DOS_DEPLOYMENT_GUIDE.md: Complete deployment documentation
- DEPLOYMENT_GUIDE.md: Technical workflow documentation
- credentials.md: Centralized credentials (AD2, NAS, Gitea)
### Analysis & Documentation (15 files)
- CTONW_ANALYSIS.md: Comprehensive compliance analysis
- CTONW_V1.2_CHANGELOG.md: Detailed v1.2 changes
- NWTOC_ANALYSIS.md: Download workflow analysis
- DOS_BATCH_ANALYSIS.md: DOS 6.22 compatibility guide
- UPDATE_WORKFLOW.md: Backup system workflow
- BEHAVIORAL_RULES_INTEGRATION_SUMMARY.md: C: drive integration
### Session Logs
- session-logs/2026-01-19-session.md: Complete session documentation
### Conversation Reorganization
- Cleaned up 156 imported conversation files
- Organized into sessions-by-date structure
- Created metadata index and large files guide
## Technical Details
### AD2 → NAS → DOS Sync Flow
1. Admin copies files to AD2: \192.168.0.6\C$\Shares\test\
2. Sync-FromNAS.ps1 runs every 15 minutes (AD2 → NAS)
3. DOS machines access via T: drive (\D2TESTNAS\test)
4. NWTOC downloads updates, CTONW uploads test data
5. Sync imports test data to AD2 database
### DOS 6.22 Compatibility
- No %COMPUTERNAME%, uses %MACHINE% variable
- No IF /I, uses multiple case-specific checks
- Proper ERRORLEVEL checking (highest values first)
- XCOPY /S for subdirectory support
- ASCII markers ([OK], [ERROR], [WARNING]) instead of emojis
### File Locations
- AD2: C:\Shares\test\COMMON\ProdSW\ (deployed)
- NAS: T:\COMMON\ProdSW\ (synced)
- DOS: C:\BAT\ (installed)
- Logs: T:\TS-4R\LOGS\8BLOG\ (test data for database import)
## Deployment Status
✅ All 7 batch files deployed to AD2 (both COMMON and _COMMON)
⏳ Pending sync to NAS (within 15 minutes)
⏳ Pending pilot deployment on TS-4R
📋 Ready for rollout to ~30 DOS machines
## Breaking Changes
CTONW v1.1 → v1.2: Test data now uploads to LOGS folder instead of ProdSW.
Existing machines must download v1.2 via NWTOC for proper database import.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>