# DOS Update System - Technical Documentation

Document Version: 1.0

Date: January 19, 2026

Audience: Engineers and System Administrators

## System Overview

The DOS Update System automatically downloads software updates and uploads test data on every machine boot. No manual intervention required.

Key Features:

- Automatic updates on boot
- Centralized file management on AD2
- 15-minute sync interval to NAS
- DOS 6.22 compatible

## System Architecture

### File Flow

┌─────────────────────────────────────────────────────────────────┐ │ AD2 Server (192.168.0.6) │ │ C:\Shares\test\COMMON\ProdSW\ │ │ │ │ Engineers place files here (via \\AD2\test\COMMON\ProdSW\) │ └──────────────────────┬──────────────────────────────────────────┘ │ │ Automatic Sync (every 15 minutes) │ ▼ ┌─────────────────────────────────────────────────────────────────┐ │ D2TESTNAS (192.168.0.9) │ │ /data/test/COMMON/ProdSW/ │ │ │ │ DOS machines access via T:\COMMON\ProdSW\ (SMB1) │ └──────────────────────┬──────────────────────────────────────────┘ │ │ NWTOC.BAT downloads updates │ ▼ ┌─────────────────────────────────────────────────────────────────┐ │ DOS Machines (~30 units: TS-01 through TS-30) │ │ C:\BAT\ and C:\ATE\ │ │ │ │ AUTOEXEC.BAT runs NWTOC + CTONW automatically on boot │ └─────────────────────────────────────────────────────────────────┘

## System Components

### AUTOEXEC.BAT

Location: C:\AUTOEXEC.BAT on each DOS machine
Function: Machine startup configuration

Executes on boot:

1. Sets machine identity (SET MACHINE=TS-XX)
2. Starts network client
3. Calls NWTOC.BAT (downloads updates)
4. Calls CTONW.BAT (uploads test data)

### NWTOC.BAT (Network to Computer)

Location: C:\BAT\NWTOC.BAT
Function: Downloads software updates from network

Download paths:

- T:\COMMON\ProdSW\*.BAT → C:\BAT\
- T:\COMMON\ProdSW\*.EXE → C:\ATE\
- T:\TS-XX\ProdSW\*.* → C:\BAT\ and C:\ATE\
- T:\COMMON\DOS\*.NEW → Staged for reboot

Features:

- Only downloads newer files (XCOPY /D flag)
- Creates .BAK backups before overwriting
- Handles system file staging (AUTOEXEC.NEW, CONFIG.NEW)

### CTONW.BAT (Computer to Network)

Location: C:\BAT\CTONW.BAT
Function: Uploads test data and programs to network

Upload paths:

- C:\BAT\*.BAT → T:\TS-XX\ProdSW\
- C:\ATE\*.EXE, *.CFG → T:\TS-XX\ProdSW\
- C:\ATE\*DATA\*.DAT → T:\TS-XX\LOGS\*LOG\

Data routing:

- Programs → ProdSW (for distribution)
- Test data → LOGS (for database import)

### DEPLOY.BAT

Location: T:\COMMON\ProdSW\DEPLOY.BAT
Function: Initial machine deployment
Usage: `T:\UPDATE.BAT TS-XX` (one-time setup)

Deployment steps:

1. Creates C:\BAT\ directory
2. Copies all batch files to C:\BAT\
3. Installs AUTOEXEC.BAT with machine name
4. Creates network backup folder T:\TS-XX\

### UPDATE.BAT (Root Redirect)

Location: T:\UPDATE.BAT
Function: Shortcut to DEPLOY.BAT
Usage: `T:\UPDATE.BAT TS-XX`

    @ECHO OFF
    REM UPDATE.BAT - Redirect to DEPLOY.BAT in proper location
    REM Usage: UPDATE.BAT machine-name
    REM Example: UPDATE.BAT TS-4R
    CALL T:\COMMON\ProdSW\DEPLOY.BAT %1

## Automatic Workflow

1. DOS machine boots
2. Network starts (C:\NET\STARTNET.BAT)
3. NWTOC runs automatically (downloads updates)
4. CTONW runs automatically (uploads test data)
5. System ready for testing

User actions required: None

## Deployment Status

### Files on AD2:

- Location: `C:\Shares\test\COMMON\ProdSW\`
- Access: `\\AD2\test\COMMON\ProdSW\`

### Sync to NAS:

- Frequency: Every 15 minutes
- Destination: `/data/test/COMMON/ProdSW/`
- DOS Access: `T:\COMMON\ProdSW\`

## DOS 6.22 Compatibility

Directory testing: Uses `*.*` wildcard instead of NUL device

    IF NOT EXIST C:\BAT\*.* MD C:\BAT

Pipe operations: Single pipes with temp files instead of multi-pipe chains

    TYPE C:\AUTOEXEC.TM1 | FIND /V "REM Dataforth" > C:\AUTOEXEC.TM2
    TYPE C:\AUTOEXEC.TM2 | FIND /V "REM Automatically" > C:\AUTOEXEC.TM3

## File List

### Core Files:

- AUTOEXEC.BAT (82 lines)
- NWTOC.BAT (221 lines)
- CTONW.BAT (272 lines)
- DEPLOY.BAT (188 lines)
- UPDATE.BAT (5 lines)

### Utility Files:

- CHECKUPD.BAT - Check available updates
- STAGE.BAT - System file staging
- REBOOT.BAT - Apply staged updates

## Support

Documentation:

- ENGINEER_HOWTO_GUIDE.md - Engineer procedures
- DEPLOYMENT_GUIDE.md - Test staff procedures

Emergency Contact:

- System Down: Contact IT immediately
- Rollback Required: See git history