4.0 KiB
UPDATE.BAT Fix - XCOPY Parameter Error
Date: 2026-01-20 Version: 2.0 → 2.1 Issue: "Invalid number of parameters" error during backup Severity: HIGH - Prevents all backups from completing
Problem Description
When running UPDATE.BAT on DOS 6.22 machines, the backup fails immediately with:
Starting backup...
This may take several minutes depending on file count.
Invalid number of parameters
0 File(s) copied
[ERROR] Backup initialization failed
Possible causes:
- Insufficient memory
- Invalid path
- Target drive not accessible
Affected Machine: TS-4R (and potentially all DOS machines)
Root Cause
Line 123 of UPDATE.BAT v2.0:
XCOPY C:\*.* T:\%MACHINE%\BACKUP /S /E /Y /D /H /K /C
The /D switch in DOS 6.22 requires a date parameter in format /D:mm-dd-yy.
DOS 6.22 XCOPY Syntax:
/Dalone is INVALID/D:01-20-26is VALID (copy files modified on or after Jan 20, 2026)
Modern XCOPY (Windows 95+):
/Dalone is VALID (copy only newer files based on file timestamp comparison)
The version 2.0 UPDATE.BAT was written with modern XCOPY syntax, not DOS 6.22 syntax.
The Fix
Removed invalid /D flag from XCOPY command:
XCOPY C:\*.* T:\%MACHINE%\BACKUP\ /S /E /Y /H /K /C
Changes:
- Removed
/Dflag (requires date parameter in DOS 6.22) - Added trailing backslash to destination path for clarity
- Removed incomplete comment line about
/Q(quiet mode - not available in DOS 6.22) - Added documentation notes explaining DOS 6.22 limitations
Testing Required
Before full rollout, test on TS-4R:
-
Copy fixed UPDATE.BAT to AD2:
Copy-Item D:\ClaudeTools\UPDATE.BAT \\192.168.0.6\C$\Shares\test\COMMON\ProdSW\ -
Wait 15 minutes for AD2→NAS sync
-
On TS-4R, run:
T: CD \COMMON\ProdSW XCOPY UPDATE.BAT C:\BAT\ /Y C: CD \BAT UPDATE -
Verify backup completes successfully
-
Check T:\TS-4R\BACKUP\ for copied files
Deployment Plan
Pilot: TS-4R (already experiencing issue) Full Rollout: All ~30 DOS machines after successful pilot
Deployment Method:
- Copy UPDATE.BAT v2.1 to AD2:
C:\Shares\test\COMMON\ProdSW\ - AD2→NAS sync happens automatically (every 15 minutes)
- Machines will get update on next NWTOC run or manual update
Alternative - Immediate Deployment: Users can manually update by running:
C:
CD \BAT
XCOPY T:\COMMON\ProdSW\UPDATE.BAT C:\BAT\ /Y
DOS 6.22 Compatibility Notes
XCOPY Switches NOT Available in DOS 6.22:
/Q- Quiet mode (added in Windows 95)/D- Copy only newer (requires/D:mm-dd-yyin DOS 6.22)/EXCLUDE:file- Exclusion lists (added in Windows NT)
Other DOS 6.22 Limitations:
- No
IF /I(case-insensitive compare) - No
FOR /Floops - No
%COMPUTERNAME%variable - No
PUSHD/POPDcommands - Maximum environment variable size: 256 bytes
Files Changed
D:\ClaudeTools\UPDATE.BAT- Version 2.0 → 2.1- Line 113-123: Removed
/Dflag from XCOPY - Line 9-10: Updated version and date
- Added DOS 6.22 compatibility notes in comments
- Line 113-123: Removed
Related Issues
Previous DOS Compatibility Fixes (2026-01-19):
- CTONW.BAT v1.0 → v1.1 - Fixed missing /S flag for subdirectories
- CTONW.BAT v1.1 → v1.2 - Fixed test data routing (ProdSW vs LOGS)
- DEPLOY.BAT v1.0 → v2.0 - Complete DOS 6.22 overhaul
This Fix (2026-01-20): 4. UPDATE.BAT v2.0 → v2.1 - Fixed /D parameter error
Success Criteria
Backup is successful when:
- No "Invalid number of parameters" error
- Files are copied (> 0 files copied)
- "[OK] Backup completed successfully" message appears
- Files visible in T:%MACHINE%\BACKUP\
Rollback Plan
If UPDATE.BAT v2.1 fails, revert to manual backup method:
XCOPY C:\*.* T:\TS-4R\BACKUP\ /S /E /Y /H /K /C
Or use previous version (if it was working):
XCOPY C:\*.* T:\TS-4R\BACKUP\ /S /E /Y /H /K
Status: Ready for deployment to AD2 Next Step: Copy to AD2 and test on TS-4R