fix: Complete DOS 6.22 compatibility overhaul for Dataforth update system

Major rewrite of all core batch files to ensure DOS 6.22 compatibility
and implement automatic update workflow.

Changes:

AUTOEXEC.BAT (82 lines):
- Rewrote with clean, concise annotations
- Fixed 3 NUL device references (changed to *.*)
- Added automatic NWTOC + CTONW calls after network start
- System now fully automatic (no manual intervention needed)

NWTOC.BAT (221 lines):
- Rewrote with clean, concise annotations
- Fixed 9 NUL device references (changed to *.*)
- No functional logic changes, improved clarity

CTONW.BAT (272 lines):
- Rewrote with clean, concise annotations
- Fixed 14 NUL device references (changed to *.*)
- Clarified test data routing (ProdSW vs LOGS)

DEPLOY.BAT (188 lines, was 391):
- Complete simplification per requirements
- Removed network drive verification (runs from network)
- Removed AUTOEXEC backup logic (template approach)
- Template-based AUTOEXEC.BAT installation
- Fixed execution order: copy files FIRST, modify AUTOEXEC SECOND
- Fixed multi-pipe DOS 6.22 issue (line 92) using temp files
- Reduced complexity by 52%

deploy-all-to-ad2.ps1 (new):
- PowerShell script to deploy all files to AD2 via WinRM
- AD2 syncs to NAS automatically

Technical fixes:
- 24 total NUL device references fixed (DOS 6.22 incompatible)
- All files verified with DOS compatibility checker
- All false positives confirmed (REM comments, single-line IFs)
- DEPLOY.BAT multi-pipe chain broken into temp file steps

Deployment:
- All files deployed to AD2:C:\Shares\test\COMMON\ProdSW\
- Files will sync to NAS automatically

Result: Fully automatic update system for ~30 DOS 6.22 machines.
Downloads updates and uploads test data on every boot.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-19 19:04:56 -07:00
parent 5cef18d791
commit 379085895e
5 changed files with 277 additions and 636 deletions

View File

@@ -1,102 +1,81 @@
@ECHO OFF
REM AUTOEXEC.BAT - DOS 6.22 startup script for Dataforth test machines
REM This file runs automatically after CONFIG.SYS during boot
REM
REM Version: 2.0 for TS-4R test machine
REM Dataforth Test Machine Startup - DOS 6.22
REM Automatically runs after CONFIG.SYS during boot
REM Version: 3.0 - Auto-update system integrated
REM Last modified: 2026-01-19
REM ==================================================================
REM STEP 1: Set environment variables
REM ==================================================================
REM Set machine name - CHANGE THIS FOR EACH MACHINE
REM Valid values: TS-4R, TS-7A, TS-12B, etc.
REM Set machine identity (configured by DEPLOY.BAT)
SET MACHINE=TS-4R
REM Set DOS path for executables
SET PATH=C:\DOS;C:\NET;C:\BATCH;C:\
REM Set DOS search path for executables
SET PATH=C:\DOS;C:\NET;C:\BAT;C:\BATCH;C:\
REM Set command prompt to show current directory
PROMPT $P$G
REM Set temporary directory
REM Set temporary file directory
SET TEMP=C:\TEMP
SET TMP=C:\TEMP
REM ==================================================================
REM STEP 2: Display startup banner
REM ==================================================================
CLS
ECHO.
ECHO ==============================================================
ECHO Dataforth Test Machine: %MACHINE%
ECHO DOS 6.22 with Network Client
ECHO DOS 6.22 with Automatic Update System
ECHO ==============================================================
ECHO.
REM ==================================================================
REM STEP 3: Create required directories
REM ==================================================================
IF NOT EXIST C:\TEMP\NUL MD C:\TEMP
IF NOT EXIST C:\BATCH\NUL MD C:\BATCH
REM ==================================================================
REM STEP 4: Start network client and map drives
REM ==================================================================
REM Create required directories if they don't exist
IF NOT EXIST C:\TEMP\*.* MD C:\TEMP
IF NOT EXIST C:\BAT\*.* MD C:\BAT
IF NOT EXIST C:\BATCH\*.* MD C:\BATCH
ECHO Starting network client...
ECHO.
REM Start network and map drives
REM Start network client and map T: and X: drives
IF EXIST C:\NET\STARTNET.BAT CALL C:\NET\STARTNET.BAT
REM Check if network started successfully by testing T: drive
IF NOT EXIST T:\NUL GOTO NET_FAILED
REM Verify T: drive is accessible
IF NOT EXIST T:\*.* GOTO NET_FAILED
ECHO [OK] Network client started
ECHO [OK] Network started
ECHO.
GOTO NET_OK
:NET_FAILED
ECHO [WARNING] Network drive mapping failed
ECHO T: drive not accessible - backup will not run
ECHO.
ECHO To start network manually, run:
ECHO C:\NET\STARTNET.BAT
ECHO.
PAUSE
GOTO SKIP_BACKUP
REM ==================================================================
REM STEP 5: Display network drive status
REM ==================================================================
:NET_OK
ECHO Network Drives:
ECHO T: = \\D2TESTNAS\test
ECHO X: = \\D2TESTNAS\datasheets
ECHO.
REM ==================================================================
REM STEP 6: Run automatic backup (OPTIONAL)
REM ==================================================================
REM Download latest software updates from network
ECHO Checking for software updates...
IF EXIST C:\BAT\NWTOC.BAT CALL C:\BAT\NWTOC.BAT
REM Uncomment the next 3 lines to enable automatic backup on boot:
REM ECHO Running automatic backup...
REM CALL C:\BATCH\UPDATE.BAT
REM IF ERRORLEVEL 1 PAUSE Backup completed - press any key...
REM Upload test data to network for database import
ECHO Uploading test data to network...
IF EXIST C:\BAT\CTONW.BAT CALL C:\BAT\CTONW.BAT
REM ==================================================================
REM STEP 7: Display ready prompt
REM ==================================================================
:SKIP_BACKUP
ECHO System ready.
ECHO.
ECHO Commands:
ECHO UPDATE - Backup C: to T:\%MACHINE%\BACKUP
ECHO CTONW - Copy files C: to network
ECHO NWTOC - Copy files network to C:
ECHO ==============================================================
ECHO System Ready
ECHO ==============================================================
ECHO.
ECHO Available Commands:
ECHO UPDATE - Full system backup to T:\%MACHINE%\BACKUP
ECHO CHECKUPD - Check for available updates
ECHO CTONW - Manual upload to network
ECHO NWTOC - Manual download from network
ECHO.
GOTO END
:NET_FAILED
ECHO [ERROR] Network drive mapping failed
ECHO T: drive not accessible
ECHO.
ECHO To start network manually:
ECHO C:\NET\STARTNET.BAT
ECHO.
ECHO Updates and backups will not work until network is available.
ECHO.
PAUSE
:END