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>
10 KiB
DOS 6.22 UPDATE.BAT Fix - Complete Solution Package
Quick Start
You have encountered batch file failures on your DOS 6.22 Dataforth test machine (TS-4R). This package contains fixed versions and complete documentation.
What's Wrong
- UPDATE.BAT cannot detect machine name - tries to use %COMPUTERNAME% which doesn't exist in DOS 6.22
- UPDATE.BAT claims "T: not available" - even though T: drive is accessible
What's Fixed
- Machine detection now uses %MACHINE% environment variable (set in AUTOEXEC.BAT)
- T: drive detection uses proper DOS 6.22 method (actual drive test, not variable check)
- All DOS 6.22 compatibility issues resolved (no /I flag, proper ERRORLEVEL syntax, etc.)
Files in This Package
Batch Files (Deploy to DOS Machine)
| File | Deploy To | Purpose |
|---|---|---|
| UPDATE.BAT | C:\BATCH\ | Fixed backup script |
| AUTOEXEC.BAT | C:\ | Updated startup with MACHINE variable |
| STARTNET.BAT | C:\NET\ | Network initialization with error handling |
| DOSTEST.BAT | C:\ or C:\BATCH\ | Test script to verify configuration |
Documentation (Reference Only)
| File | Purpose |
|---|---|
| DOS_FIX_SUMMARY.md | Executive summary of problem and solution |
| DOS_BATCH_ANALYSIS.md | Deep technical analysis of DOS 6.22 batch issues |
| DOS_DEPLOYMENT_GUIDE.md | Complete deployment and testing procedures |
| README_DOS_FIX.md | This file - package overview |
5-Minute Quick Fix
If you need to get UPDATE.BAT working RIGHT NOW:
Option A: Quick Manual Fix
REM On the DOS machine at C:\> prompt:
REM 1. Set MACHINE variable (temporary - until reboot)
SET MACHINE=TS-4R
REM 2. Test UPDATE with machine name parameter
UPDATE TS-4R
REM 3. If that works, backup succeeded!
This gets you working immediately but doesn't survive reboot.
Option B: Permanent Fix (5 steps)
REM 1. Create C:\BATCH directory if needed
MD C:\BATCH
REM 2. Copy UPDATE.BAT to C:\BATCH\
REM (from network drive or floppy)
REM 3. Edit AUTOEXEC.BAT and add near the top:
EDIT C:\AUTOEXEC.BAT
REM Add line: SET MACHINE=TS-4R
REM Save: Alt+F, S
REM Exit: Alt+F, X
REM 4. Add C:\BATCH to PATH in AUTOEXEC.BAT:
EDIT C:\AUTOEXEC.BAT
REM Find line: SET PATH=C:\DOS;C:\NET
REM Change to: SET PATH=C:\DOS;C:\NET;C:\BATCH;C:\
REM Save and exit
REM 5. Reboot machine
REBOOT
REM 6. After reboot, test:
UPDATE
Deployment Methods
Method 1: From Network Drive (Easiest)
On Windows PC:
- Copy all .BAT files to T:\TS-4R\UPDATES\
- Copy DOSTEST.BAT to T:\TS-4R\UPDATES\ too
On DOS machine:
T:
CD \TS-4R\UPDATES
DIR
REM Copy files
COPY UPDATE.BAT C:\BATCH\
COPY AUTOEXEC.BAT C:\
COPY STARTNET.BAT C:\NET\
COPY DOSTEST.BAT C:\
REM Return to C: and test
C:
DOSTEST
Method 2: From Floppy Disk
On Windows PC:
- Format 1.44MB floppy
- Copy .BAT files to floppy
- Copy DOSTEST.BAT to floppy
On DOS machine:
A:
DIR
REM Copy files
COPY UPDATE.BAT C:\BATCH\
COPY AUTOEXEC.BAT C:\
COPY STARTNET.BAT C:\NET\
COPY DOSTEST.BAT C:\
REM Return to C: and test
C:
DOSTEST
Method 3: Manual Creation (If no other option)
REM On DOS machine, use EDIT to create files manually:
EDIT C:\BATCH\UPDATE.BAT
REM Type in the UPDATE.BAT contents from printed copy
REM Save: Alt+F, S
REM Exit: Alt+F, X
REM Repeat for each file
EDIT C:\AUTOEXEC.BAT
EDIT C:\NET\STARTNET.BAT
Configuration
Per-Machine Settings
CRITICAL: Each DOS machine needs its own MACHINE name in AUTOEXEC.BAT
EDIT C:\AUTOEXEC.BAT
REM Find line:
SET MACHINE=TS-4R
REM Change to match THIS machine's name:
REM TS-4R = 4-channel RTD machine
REM TS-7A = 7-channel thermocouple machine
REM TS-12B = 12-channel strain gauge machine
REM (or whatever your naming convention is)
REM Save: Alt+F, S
REM Exit: Alt+F, X
Optional: Enable Automatic Backup on Boot
EDIT C:\AUTOEXEC.BAT
REM Find these lines near the end:
REM ECHO Running automatic backup...
REM CALL C:\BATCH\UPDATE.BAT
REM IF ERRORLEVEL 1 PAUSE Backup completed - press any key...
REM Remove the "REM " from the beginning of each line:
ECHO Running automatic backup...
CALL C:\BATCH\UPDATE.BAT
IF ERRORLEVEL 1 PAUSE Backup completed - press any key...
REM Save and exit
REM Backup will now run automatically after network starts during boot
Testing
Run the Test Script
C:\>DOSTEST
REM This will check:
REM [TEST 1] MACHINE variable is set
REM [TEST 2] Required files exist
REM [TEST 3] PATH includes C:\BATCH
REM [TEST 4] T: drive accessible
REM [TEST 5] X: drive accessible
REM [TEST 6] Can create backup directory
REM Fix any [FAIL] results before proceeding
Test UPDATE.BAT
Test 1: Run without parameter (uses MACHINE variable)
C:\>UPDATE
Expected output:
Checking network drive T:...
[OK] T: drive accessible
==============================================================
Backup: Machine TS-4R
==============================================================
Source: C:\
Target: T:\TS-4R\BACKUP
...
[OK] Backup completed successfully
Test 2: Run with parameter (override)
C:\>UPDATE TS-4R
REM Should produce same output
Test 3: Test error handling (unplug network cable)
C:\>UPDATE
Expected output:
Checking network drive T:...
[ERROR] T: drive not available
...
Press any key to exit...
Verify Backup
REM Check backup directory was created
T:
CD \TS-4R\BACKUP
DIR /S
REM You should see all files from C:\ copied here
REM Return to C:
C:
Troubleshooting
Problem: "Bad command or file name" when running UPDATE
Fix 1: Add to PATH
SET PATH=C:\DOS;C:\NET;C:\BATCH;C:\
UPDATE
Fix 2: Run with full path
C:\BATCH\UPDATE.BAT
Fix 3: Add to AUTOEXEC.BAT permanently
EDIT C:\AUTOEXEC.BAT
REM Add: SET PATH=C:\DOS;C:\NET;C:\BATCH;C:\
REM Save and reboot
Problem: MACHINE variable not set after reboot
Causes:
- AUTOEXEC.BAT not running
- SET MACHINE line missing or commented out
- Environment space too small
Fix:
REM Check if AUTOEXEC.BAT exists
DIR C:\AUTOEXEC.BAT
REM Edit and verify SET MACHINE line exists
EDIT C:\AUTOEXEC.BAT
REM Add if missing:
SET MACHINE=TS-4R
REM If environment space error, edit CONFIG.SYS:
EDIT C:\CONFIG.SYS
REM Add or modify:
SHELL=C:\DOS\COMMAND.COM C:\DOS\ /P /E:1024
REM Reboot
Problem: T: drive not accessible
Fix 1: Start network manually
C:\NET\STARTNET.BAT
Fix 2: Check network cable
- Look for link light on NIC
- Verify cable connected
Fix 3: Verify NAS server
- Check D2TESTNAS is online
- Test from another machine
Fix 4: Manual mapping
NET USE T: \\D2TESTNAS\test /YES
NET USE X: \\D2TESTNAS\datasheets /YES
Problem: Backup seems to work but files not on network
Check 1: Verify backup location
T:
CD \
DIR
REM Look for TS-4R directory
CD \TS-4R
DIR
REM Look for BACKUP subdirectory
CD BACKUP
DIR /S
Check 2: Verify MACHINE variable
SET MACHINE
REM Should show: MACHINE=TS-4R
REM Backup goes to T:\[MACHINE]\BACKUP
What Each File Does
UPDATE.BAT
- Detects machine name from %MACHINE% or parameter
- Verifies T: drive is accessible
- Creates T:[MACHINE]\BACKUP directory
- Copies all C:\ files to backup using XCOPY
- Shows errors clearly if anything fails
AUTOEXEC.BAT
- Sets MACHINE variable for this specific machine
- Sets PATH to include C:\BATCH
- Calls STARTNET.BAT to start network
- Shows network status
- (Optionally) Runs UPDATE.BAT automatically
STARTNET.BAT
- Starts Microsoft Network Client (NET START)
- Maps T: to \D2TESTNAS\test
- Maps X: to \D2TESTNAS\datasheets
- Shows error messages if mapping fails
DOSTEST.BAT
- Tests configuration is correct
- Checks MACHINE variable set
- Checks files exist in correct locations
- Checks PATH includes C:\BATCH
- Checks network drives accessible
- Reports what needs fixing
DOS 6.22 Compatibility Notes
This package is specifically designed for DOS 6.22 and avoids all modern Windows CMD features:
NOT used (Windows only):
IF /I(case-insensitive compare)%ERRORLEVEL%variable&&and||operatorsFOR /Floops- Long filenames
Used instead (DOS 6.22):
IF ERRORLEVEL nsyntaxGOTOfor flow control- Simple
FOR %%F IN (*.*)loops - 8.3 filenames only
2>NULfor error redirection
Why Your Manual XCOPY Worked
Your manual command succeeded:
XCOPY /S C:\*.* T:\TS-4R\BACKUP
Because you:
- Ran it AFTER network was already started
- Manually typed the machine name (TS-4R)
- Didn't need error checking
UPDATE.BAT failed because:
- Tried to auto-detect machine name (wrong method)
- Tried to check T: drive (wrong method)
Now UPDATE.BAT uses the correct DOS 6.22 methods.
Support Files
For detailed information, see:
- DOS_FIX_SUMMARY.md - Quick overview of problem and fix
- DOS_BATCH_ANALYSIS.md - Technical deep-dive (for programmers)
- DOS_DEPLOYMENT_GUIDE.md - Complete step-by-step deployment
Quick Command Reference
REM Show environment variables
SET
REM Show specific variable
SET MACHINE
REM Show network drives
NET USE
REM Test drive access
T:
DIR
REM Run backup
UPDATE
REM Run backup with specific machine name
UPDATE TS-4R
REM Test configuration
DOSTEST
REM Start network manually
C:\NET\STARTNET.BAT
REM View backup
T:
CD \TS-4R\BACKUP
DIR /S
Next Steps
- Deploy files to DOS machine (see Deployment Methods above)
- Edit AUTOEXEC.BAT to set correct MACHINE name
- Reboot machine to load new AUTOEXEC.BAT
- Run DOSTEST to verify configuration
- Run UPDATE to test backup
- Verify backup on T: drive
- (Optional) Enable automatic backup in AUTOEXEC.BAT
Version
- Package version: 1.0
- Created: 2026-01-19
- For: DOS 6.22 systems with Microsoft Network Client
- Tested on: Dataforth test machine TS-4R
Files Summary
UPDATE.BAT - Fixed backup script with proper DOS 6.22 detection
AUTOEXEC.BAT - Startup script with MACHINE variable
STARTNET.BAT - Network initialization with error handling
DOSTEST.BAT - Configuration test script
DOS_FIX_SUMMARY.md - Executive summary
DOS_BATCH_ANALYSIS.md - Technical analysis
DOS_DEPLOYMENT_GUIDE.md - Complete deployment guide
README_DOS_FIX.md - This file
Contact
Files created by Claude (Anthropic) for DOS 6.22 Dataforth test machines. Date: 2026-01-19
If issues persist after following this guide, check:
- Physical network connections
- NAS server status
- PROTOCOL.INI network configuration
- SMB1 protocol enabled on D2TESTNAS