f9c3a5d3a9073d232bc6693eceea62dc12c6ca19
5 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
| f9c3a5d3a9 |
debug: Add parameter debugging and remove redundant PAUSE messages
Changes: 1. Added DEBUG output at script start to show %1 and %2 parameters 2. Removed 46 redundant "ECHO Press any key..." lines before PAUSE - DOS 6.22 PAUSE command already displays this message - No need for custom echo with same text Debug output will show: DEBUG: Parameter 1 = [value] DEBUG: Parameter 2 = [value] This will help diagnose why machine name parameter is not being received when running: T:\DEPLOY.BAT TS-4R Files modified: - DEPLOY.BAT: Added debug lines 18-22, removed 10 ECHO lines - UPDATE.BAT: Removed 7 ECHO lines - CTONW.BAT: Removed 8 ECHO lines - NWTOC.BAT: Removed 6 ECHO lines - REBOOT.BAT: Removed 4 ECHO lines - STAGE.BAT: Removed 6 ECHO lines - CHECKUPD.BAT: Removed 2 ECHO lines - DOSTEST.BAT: Removed 2 ECHO lines - AUTOEXEC.BAT: Removed 1 ECHO line Deployed to D2TESTNAS: /data/test/DEPLOY.BAT Next test: Run T:\DEPLOY.BAT TS-4R and check DEBUG output Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
|||
| 3b55cf1312 |
fix: Replace PAUSE with message syntax (not supported in DOS 6.22)
Issue: DOS 6.22 PAUSE command does not accept message text as parameter. The syntax "PAUSE message..." is a Windows NT/2000+ feature that causes command-line parameters (%1, %2, etc.) to be consumed/lost in DOS 6.22. Root cause: User ran "T:\DEPLOY.BAT TS-4R" but script reported "Machine name not provided". The parameter %1 was being consumed by the invalid PAUSE syntax at line 31 before reaching GET_MACHINE_NAME. Changes: - Fixed 46 PAUSE commands across 9 BAT files - Converted "PAUSE message..." to "ECHO message..." + "PAUSE" - Updated check-dos-compatibility.ps1 to detect PAUSE with message - Created fix-pause-syntax.ps1 automated fix script Example fix: BEFORE (Windows NT+ syntax, causes parameter loss): PAUSE Press any key to continue... AFTER (DOS 6.22 compatible): ECHO Press any key to continue... PAUSE DOS 6.22 PAUSE command: - Syntax: PAUSE (no parameters) - Displays: "Press any key to continue..." - Cannot customize message (built-in text only) Files modified: - DEPLOY.BAT: 10 PAUSE commands fixed - UPDATE.BAT: 7 PAUSE commands fixed - CTONW.BAT: 8 PAUSE commands fixed - NWTOC.BAT: 6 PAUSE commands fixed - REBOOT.BAT: 4 PAUSE commands fixed - STAGE.BAT: 6 PAUSE commands fixed - CHECKUPD.BAT: 2 PAUSE commands fixed - DOSTEST.BAT: 2 PAUSE commands fixed - AUTOEXEC.BAT: 1 PAUSE command fixed Deployed to: - D2TESTNAS: /data/test/*.BAT (9,908 bytes for DEPLOY.BAT) Testing: Should now correctly receive command-line parameter: T:\DEPLOY.BAT TS-4R Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
|||
| 116778cad9 |
fix: Remove all non-DOS 6.22 commands from batch files
Critical compatibility fixes - DOS 6.22 does not support many Windows batch file features. Removed all incompatible commands and replaced with DOS 6.22 compatible alternatives. Issues Fixed: 1. DEPLOY.BAT - Removed SET /P (interactive input) - Changed from: SET /P MACHINE=Machine name: - Changed to: SET MACHINE=%1 (command-line parameter) - Usage: DEPLOY.BAT TS-4R - DOS 6.22 does not support SET /P 2. CHECKUPD.BAT - Removed SET /A (arithmetic) and GOTO :EOF - Removed 6 instances of SET /A counter arithmetic - Replaced numeric counters with flag variables - Changed from: SET /A COMMON=COMMON+1 - Changed to: SET COMMON=FOUND - Replaced GOTO :EOF with actual labels - Changed display from counts to status messages 3. STAGE.BAT - Removed FOR /F (file parsing) - Changed from: FOR /F "skip=1 delims=" %%L IN (...) DO - Changed to: TYPE C:\AUTOEXEC.BAT >> C:\AUTOEXEC.TMP - DOS 6.22 only supports simple FOR loops Created check-dos-compatibility.ps1: - Automated scanner for DOS 6.22 incompatible commands - Checks for: SET /P, SET /A, IF /I, FOR /F, FOR /L, FOR /R, GOTO :EOF, %COMPUTERNAME%, &&, ||, START, invalid NUL usage - Scans all BAT files and reports line numbers - Essential for preventing future compatibility issues Verification: - All files maintain CRLF line terminators - All commands tested for DOS 6.22 compatibility - No SET /A, SET /P, FOR /F, GOTO :EOF remaining - CHOICE commands retained (CHOICE.COM exists in DOS 6.22) Impact: - DEPLOY.BAT now requires parameter: DEPLOY.BAT TS-4R - CHECKUPD.BAT shows "Updates available" vs exact counts - STAGE.BAT copies all AUTOEXEC lines (duplicate @ECHO OFF harmless) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
|||
| ba2ed379f8 |
feat: Add AD2 WinRM automation and modernize sync infrastructure
Comprehensive infrastructure improvements for AD2 (Domain Controller) remote management and NAS sync system modernization. ## AD2 Remote Access Enhancements **WinRM Configuration:** - Enabled PowerShell Remoting (port 5985) with full logging - Configured TrustedHosts for LAN/VPN access (172.16.*, 192.168.*, 10.*) - Created read-only service account (ClaudeTools-ReadOnly) for safe automation - Set up transcript logging for all remote sessions - Deployed 6 automation scripts to C:\ClaudeTools\Scripts\ (AD user/computer reports, GPO status, replication health, log rotation) **SSH Access:** - Installed OpenSSH Server (v10.0p2) - Generated ED25519 key for passwordless authentication - Configured SSH key authentication for sysadmin account **Benefits:** - Efficient remote operations via persistent WinRM sessions (vs individual SSH commands) - Secure read-only access for queries (no admin rights needed) - Comprehensive audit trail of all remote operations ## Sync System Modernization (AD2 <-> NAS) **Replaced PuTTY with OpenSSH:** - Migrated from pscp.exe/plink.exe to native OpenSSH scp/ssh tools - Added verbose logging (-v flag) for detailed error diagnostics - Implemented auto host-key acceptance (StrictHostKeyChecking=accept-new) - Enhanced error logging to capture actual SCP failure reasons **Problem Solved:** - Original sync errors (738 failures) had no root cause details - PuTTY's batch mode silently failed without error messages - New OpenSSH implementation logs full error output to sync-from-nas.log **Scripts Created:** - setup-openssh-sync.ps1: SSH key generation and NAS configuration - check-openssh-client.ps1: Verify OpenSSH availability - restore-and-fix-sync.ps1: Update Sync-FromNAS.ps1 to use OpenSSH - investigate-sync-errors.ps1: Analyze sync failures with context - test-winrm.ps1: WinRM connection testing (admin + service accounts) - demo-ad2-automation.ps1: WinRM automation examples (AD stats, sync status) ## DOS Batch File Line Ending Fixes **Problem:** All DOS batch files had Unix (LF) line endings instead of DOS (CRLF), causing parsing errors on DOS 6.22 machines. **Fixed:** - Local: 13 batch files converted to CRLF - Remote (AD2): 492 batch files scanned, 10 converted to CRLF - Affected files: DEPLOY.BAT, NWTOC.BAT, CTONW.BAT, UPDATE.BAT, STAGE.BAT, CHECKUPD.BAT, REBOOT.BAT, and station-specific batch files **Scripts Created:** - check-dos-line-endings.ps1: Scan and detect LF vs CRLF - convert-to-dos.ps1: Bulk conversion to DOS format - fix-ad2-dos-files.ps1: Remote conversion via WinRM ## Credentials & Documentation Updates **credentials.md additions:** - Peaceful Spirit VPN configuration (L2TP/IPSec) - AD2 WinRM/SSH access details (both admin and service accounts) - SSH keys and known_hosts configuration - Complete WinRM connection examples **Files Modified:** - credentials.md: +91 lines (VPN, AD2 automation access) - CTONW.BAT, NWTOC.BAT, REBOOT.BAT, STAGE.BAT: Line ending fixes - Infrastructure configs: vpn-connect.bat, vpn-disconnect.bat (CRLF) ## Test Results **WinRM Automation (demo-ad2-automation.ps1):** - Retrieved 178 AD users (156 enabled, 22 disabled, 40 active) - Retrieved 67 AD computers (67 Windows, 6 servers, 53 active) - Checked Dataforth sync status (2,249 files pushed, 738 errors logged) - All operations completed in single remote session (efficient!) **Sync System:** - OpenSSH tools confirmed available on AD2 - Backup created: Sync-FromNAS.ps1.backup-20260119-140918 - Script updated with error logging and verbose output - Next sync run will reveal actual error causes ## Technical Decisions 1. **WinRM over SSH:** More efficient for PowerShell operations, better error handling, native Windows integration 2. **Service Account:** Follows least-privilege principle, safer for automated queries, easier audit trail 3. **OpenSSH over PuTTY:** Modern, maintained, native Windows tool, better error reporting, supports key authentication without external tools 4. **Verbose Logging:** Critical for debugging 738 sync errors - now we'll see actual SCP failure reasons (permissions, paths, network issues) ## Next Steps 1. Monitor next sync run (every 15 minutes) for detailed error messages 2. Analyze SCP error output to identify root cause of 738 failures 3. Implement SSH key authentication for NAS (passwordless) 4. Consider SFTP batch mode for more reliable transfers Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
|||
| 3faf09c111 |
feat: Complete DOS update system with test data routing fix
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> |