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>
35 lines
1.8 KiB
PowerShell
35 lines
1.8 KiB
PowerShell
# Deploy all 4 fixed BAT files to AD2 via WinRM
|
|
$Password = ConvertTo-SecureString "Paper123!@#" -AsPlainText -Force
|
|
$Credential = New-Object System.Management.Automation.PSCredential("INTRANET\sysadmin", $Password)
|
|
|
|
Write-Host "[INFO] Connecting to AD2..." -ForegroundColor Cyan
|
|
$Session = New-PSSession -ComputerName 192.168.0.6 -Credential $Credential -ErrorAction Stop
|
|
Write-Host "[OK] Connected to AD2" -ForegroundColor Green
|
|
|
|
# Check/create directory on AD2
|
|
Write-Host "[INFO] Checking directory structure..." -ForegroundColor Cyan
|
|
Invoke-Command -Session $Session -ScriptBlock {
|
|
if (-not (Test-Path "C:\Shares\test\COMMON\ProdSW")) {
|
|
New-Item -Path "C:\Shares\test\COMMON\ProdSW" -ItemType Directory -Force | Out-Null
|
|
}
|
|
}
|
|
|
|
Write-Host "[INFO] Copying AUTOEXEC.BAT..." -ForegroundColor Cyan
|
|
Copy-Item "D:\ClaudeTools\AUTOEXEC.BAT" -Destination "C:\Shares\test\COMMON\ProdSW\" -ToSession $Session -ErrorAction Stop
|
|
Write-Host "[OK] AUTOEXEC.BAT deployed" -ForegroundColor Green
|
|
|
|
Write-Host "[INFO] Copying NWTOC.BAT..." -ForegroundColor Cyan
|
|
Copy-Item "D:\ClaudeTools\NWTOC.BAT" -Destination "C:\Shares\test\COMMON\ProdSW\" -ToSession $Session -ErrorAction Stop
|
|
Write-Host "[OK] NWTOC.BAT deployed" -ForegroundColor Green
|
|
|
|
Write-Host "[INFO] Copying CTONW.BAT..." -ForegroundColor Cyan
|
|
Copy-Item "D:\ClaudeTools\CTONW.BAT" -Destination "C:\Shares\test\COMMON\ProdSW\" -ToSession $Session -ErrorAction Stop
|
|
Write-Host "[OK] CTONW.BAT deployed" -ForegroundColor Green
|
|
|
|
Write-Host "[INFO] Copying DEPLOY.BAT..." -ForegroundColor Cyan
|
|
Copy-Item "D:\ClaudeTools\DEPLOY.BAT" -Destination "C:\Shares\test\COMMON\ProdSW\" -ToSession $Session -ErrorAction Stop
|
|
Write-Host "[OK] DEPLOY.BAT deployed" -ForegroundColor Green
|
|
|
|
Remove-PSSession $Session
|
|
Write-Host "[SUCCESS] All 4 files deployed to AD2:C:\Shares\test\COMMON\ProdSW\" -ForegroundColor Green
|