Files
claudetools/clients/valleywide/app-modernization/source-analysis/scan-d-drive.ps1
Mike Swanson 5359e7c49e feat(valleywide): recover VWP Orders VB6 source from D: backup drive
Recovered Darv's VB6 source for the Valley Wide Plastering Orders
application from the D: backup drive (label "Backup", 8 TB, 5.3 TB used).
This is the first time we've had the actual source — prior session only
had a single frmPayroll.frm from the AD server.

Three project variants identified across two snapshots:
- Full-Project/   (2,129 files, 124 MB) — D:\Office-Estimates\Darv\Full\Project\
- Kingston-Project/ (2,189 files, 130 MB) — D:\Office-Estimates\Darv\Kingston\Project\
- Source/         (170 files, 559 MB)   — D:\Office-Estimates\Darv\Source\ wholesale
- SOURCE-HOLD/    (3 files, 1 MB)       — D:\Office-Estimates\Darv\SOURCE HOLD\

Latest ORDERS_C.vbp date is 2020-06-09 (Kingston snapshot). Production
Orders_10A.exe was live as of April 2024 — open question whether newer
source exists on other backup drives Mike will scan next.

Also includes per-category and per-keyword analysis CSVs from a WizTree
file-list export, plus the analyzer script that produced them
(re-runnable for the next drive's CSV).

VMs (VWIN7-DW.vdi 8.3 GB + XP-for-ORDERS_copy.vdi 2.8 GB), the live
VWP.mdb, and the 393 MB raw WizTree CSV stay on disk only — gitignored.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 17:36:27 -07:00

122 lines
4.2 KiB
PowerShell

# Full D:\ scan for VWP modernization-relevant files.
# Outputs CSV with category, full path, size, last write time.
$ErrorActionPreference = 'SilentlyContinue'
# Extension -> category
$extMap = @{
'.vbp' = 'vb6-project'
'.vbg' = 'vb6-project-group'
'.vbw' = 'vb6-workspace'
'.frm' = 'vb6-form'
'.frx' = 'vb6-form-resource'
'.bas' = 'vb6-module'
'.cls' = 'vb6-class'
'.ctl' = 'vb6-usercontrol'
'.ctx' = 'vb6-usercontrol-resource'
'.res' = 'resource'
'.mdb' = 'access-mdb'
'.accdb' = 'access-accdb'
'.rpt' = 'crystal-report'
'.ism' = 'installshield-project'
'.isproj' = 'installshield-project'
}
# Folder-name keywords -> tag
$folderKeywords = @('darv', 'source', 'orders', 'vwp', 'valleywide', 'denali')
$root = 'D:\'
$outCsv = 'C:\Users\guru\ClaudeTools\clients\valleywide\app-modernization\source-analysis\D-drive-scan-2026-05-16.csv'
$outFolders = 'C:\Users\guru\ClaudeTools\clients\valleywide\app-modernization\source-analysis\D-drive-folders-2026-05-16.csv'
$skipDirs = @('$RECYCLE.BIN', 'System Volume Information')
$start = Get-Date
Write-Host "[INFO] Starting scan of $root at $start"
# --- File scan (extension match) ---
$results = New-Object System.Collections.Generic.List[object]
$fileCount = 0
$lastReport = Get-Date
try {
$stack = New-Object System.Collections.Generic.Stack[string]
$stack.Push($root)
while ($stack.Count -gt 0) {
$dir = $stack.Pop()
# Skip known noise dirs
$leaf = Split-Path $dir -Leaf
if ($skipDirs -contains $leaf) { continue }
try {
foreach ($f in [System.IO.Directory]::EnumerateFiles($dir)) {
$fileCount++
$ext = [System.IO.Path]::GetExtension($f).ToLower()
if ($extMap.ContainsKey($ext)) {
try {
$fi = [System.IO.FileInfo]::new($f)
$results.Add([pscustomobject]@{
Category = $extMap[$ext]
Path = $f
SizeKB = [math]::Round($fi.Length / 1KB, 1)
Modified = $fi.LastWriteTime.ToString('yyyy-MM-dd HH:mm')
}) | Out-Null
} catch {}
}
# Progress report every 60s
if (((Get-Date) - $lastReport).TotalSeconds -ge 60) {
Write-Host "[PROGRESS] $fileCount files seen, $($results.Count) matches, current dir: $dir"
$lastReport = Get-Date
}
}
} catch {}
try {
foreach ($sub in [System.IO.Directory]::EnumerateDirectories($dir)) {
$stack.Push($sub)
}
} catch {}
}
} catch {
Write-Host "[ERROR] $_"
}
$results | Sort-Object Category, Path | Export-Csv -Path $outCsv -NoTypeInformation -Encoding UTF8
Write-Host "[OK] Wrote $($results.Count) file matches to $outCsv"
# --- Folder scan (name match for keywords) ---
$folderResults = New-Object System.Collections.Generic.List[object]
$dirStack = New-Object System.Collections.Generic.Stack[string]
$dirStack.Push($root)
while ($dirStack.Count -gt 0) {
$dir = $dirStack.Pop()
$leaf = Split-Path $dir -Leaf
if ($skipDirs -contains $leaf) { continue }
$leafLower = $leaf.ToLower()
foreach ($kw in $folderKeywords) {
if ($leafLower -like "*$kw*") {
$folderResults.Add([pscustomobject]@{
Keyword = $kw
Path = $dir
}) | Out-Null
break
}
}
try {
foreach ($sub in [System.IO.Directory]::EnumerateDirectories($dir)) {
$dirStack.Push($sub)
}
} catch {}
}
$folderResults | Sort-Object Keyword, Path | Export-Csv -Path $outFolders -NoTypeInformation -Encoding UTF8
Write-Host "[OK] Wrote $($folderResults.Count) folder matches to $outFolders"
$elapsed = (Get-Date) - $start
Write-Host "[DONE] Scanned $fileCount files in $([math]::Round($elapsed.TotalMinutes,1)) min"
# --- Summary by category ---
Write-Host "`n=== Summary by category ==="
$results | Group-Object Category | Sort-Object Count -Descending | ForEach-Object {
Write-Host ("{0,-25} {1,5}" -f $_.Name, $_.Count)
}