Files
claudetools/clients/dataforth/scripts/push-fixed-bat-files.ps1
Mike Swanson 5cbd49ce24 Reorganize repo: compartmentalize scripts by client/project
Move 150+ scripts from root and scripts/ into client/project directories:
- clients/dataforth/scripts/ (110 files: AD2, sync, SSH, DB, DOS scripts)
- clients/bg-builders/scripts/ (14 files: Lesley mgmt, Exchange, termination)
- clients/internal-infrastructure/scripts/ (10 files: GDAP, Gitea, backups)
- projects/msp-tools/scripts/ (9 files: CIPP, MSP onboarding, Datto)
- projects/gururmm-agent/scripts/ (3 files: API test, JWT, record counts)
- clients/glaztech/scripts/ (1 file: CentraStage removal)

Also reorganized:
- VPN scripts → infrastructure/vpn-configs/
- Retrieved API/JS files → api/
- Forum posts → projects/community-forum/forum-posts/
- SSH docs → clients/internal-infrastructure/docs/
- NWTOC/CTONW docs → projects/wrightstown-smarthome/docs/
- ACG website files → projects/internal/acg-website-2025/
- Dataforth docs → clients/dataforth/docs/
- schema-retrieved.sql → docs/database/

Deleted 24 tmp_*.ps1 one-off debug scripts (preserved in git history).
Root reduced from 220+ files to 62 items (docs + directories only).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 17:15:07 -07:00

71 lines
2.2 KiB
PowerShell

# Copy fixed batch files to AD2, which will sync to NAS
$password = ConvertTo-SecureString "Paper123!@#" -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential("INTRANET\sysadmin", $password)
Write-Host "=== Pushing Fixed BAT Files to AD2 ===" -ForegroundColor Cyan
Write-Host ""
# List of fixed batch files
$batFiles = @(
"DEPLOY.BAT",
"NWTOC.BAT",
"CTONW.BAT",
"UPDATE.BAT",
"STAGE.BAT",
"CHECKUPD.BAT",
"REBOOT.BAT",
"AUTOEXEC.BAT",
"STARTNET.BAT",
"DOSTEST.BAT"
)
$localPath = "D:\ClaudeTools"
$pushedCount = 0
$errorCount = 0
foreach ($batFile in $batFiles) {
$localFile = Join-Path $localPath $batFile
if (Test-Path $localFile) {
Write-Host "[FOUND] $batFile" -ForegroundColor Green
# Copy to AD2
Invoke-Command -ComputerName 192.168.0.6 -Credential $cred -ScriptBlock {
param($fileName, $content)
# Determine destination based on file type
if ($fileName -match "AUTOEXEC|STARTNET|CONFIG") {
# System files go to COMMON\DOS
$destPath = "C:\Shares\test\COMMON\DOS\$fileName"
} else {
# Utility scripts go to COMMON root or appropriate location
$destPath = "C:\Shares\test\$fileName"
}
# Write the file
$content | Out-File -FilePath $destPath -Encoding ASCII -Force
Write-Host " [OK] Copied to: $destPath" -ForegroundColor Green
return $destPath
} -ArgumentList $batFile, (Get-Content $localFile -Raw)
$pushedCount++
} else {
Write-Host "[MISSING] $batFile - not found at $localFile" -ForegroundColor Yellow
$errorCount++
}
}
Write-Host ""
Write-Host "=== Summary ===" -ForegroundColor Cyan
Write-Host "Files pushed: $pushedCount" -ForegroundColor Green
Write-Host "Files missing: $errorCount" -ForegroundColor Yellow
if ($pushedCount -gt 0) {
Write-Host ""
Write-Host "[INFO] Files copied to AD2" -ForegroundColor Cyan
Write-Host "[INFO] Next sync (every 15 min) will push to NAS" -ForegroundColor Cyan
Write-Host "[INFO] Then accessible from DOS machines at T:\COMMON\" -ForegroundColor Cyan
}