Give it the file
The first argument that is not a switch is the program: a VB1–VB6 EXE, DLL or OCX, a .NET assembly, a twinBASIC or QuickBASIC EXE. Quote any path that contains spaces.
The same recovery engine that drives the window also runs without one.
Point VBSourceCodeRecovery.exe at a file from a batch file,
PowerShell, a build server or a scheduled task and it decompiles the program,
writes the rebuilt project or Visual Studio solution, logs what it did, returns
an exit code and closes. No dialogs, no clicks, nothing leaves your machine.
This page is the complete reference: every switch, every exit code, where the
output goes, and a handful of batch recipes.
Install the software, activate the site license once (see deploying the license), then run it with the file to recover and where the project should go.
The first argument that is not a switch is the program: a VB1–VB6 EXE, DLL or OCX, a .NET assembly, a twinBASIC or QuickBASIC EXE. Quote any path that contains spaces.
/out names the folder for the rebuilt project. Add
/vbp for a Visual Basic project or /solution for a
.NET one — or neither, to only analyse.
0 means done; anything else means look at
decompile.log in the output folder. That makes it safe to
loop over hundreds of files unattended.
Switches can appear in any order and are not case-sensitive. The right
action is chosen for the file type automatically: a Visual Basic file always
yields a .vbp project and a .NET assembly always yields a
solution, whichever generate switch you pass.
VBSourceCodeRecovery.exe <inputfile> [/out <dir>] [/vbp] [/dism] [/solution] [/dodi] VBSourceCodeRecovery.exe /activate <license key> VBSourceCodeRecovery.exe /devcode VBSourceCodeRecovery.exe /gui <inputfile> VBSourceCodeRecovery.exe /?
| Switch | What it does |
|---|---|
<inputfile> | The program to recover — VB 1, 2, 3, 4, 5 or 6 (EXE, DLL, OCX), a .NET assembly, a twinBASIC EXE or a QuickBASIC EXE. The first argument that is not a switch. |
/out <dir> | Folder for the rebuilt project or solution. Created if missing. Without it, output lands in the file's dump folder (below). |
/vbp | Generate the Visual Basic project: .vbp plus every form (.frm + .frx), module, class, user control, property page, user document and designer. |
/dism | Generate the same project, but with the raw native disassembly as each procedure body instead of the reconstructed Basic. For audits, and for procedures the reconstruction marks as uncertain. |
/solution | For a .NET assembly: write a Visual Studio .sln with a C# project and a VB.NET project, one source file per class. /sln is accepted too. |
/dodi | VB2 / VB3 only: run the classic DoDi decompiler engine instead of the built-in one, for a second opinion. Requires /out. |
/gui <file> | Open the file in the window instead of running headless. Handy for scripts that hand a file to a person. |
/activate <key> | Activate this computer online with your License Key, save the Activation Code, and exit. Meant for deployment scripts — see below. |
/devcode | Write this computer's Device Code and license state to decompile.log, for manual (offline) activation. |
/? | Print usage. /help and /h do the same. |
Run it from its install folder (or with the working directory set there) so
it can find its data files — the API database, vb6.olb, the language
files and the runtime OCX/DLLs that ship with it. Quote paths with spaces.
Nothing else is required: no environment variables, no registry settings, no
services.
| Location | Contents |
|---|---|
</out dir> |
The deliverable. For Visual Basic: <Project>.vbp and one file per component. The .vbp carries the Object= and Reference= lines for every OCX and type library the original used, so a missing dependency shows up the moment you open it in VB6. For .NET: .sln plus a C# and a VB.NET project. |
decompile.log |
In the output folder. One line per run with the timestamp, the exit code and what happened — Processed X (VB6); generated VB project in Y, or the error. Append-only, so a batch leaves an audit trail. Attach it to a bug report. |
decompile_progress.log |
Step-by-step progress with timings: every procedure decompiled and how long it took. Useful for spotting the one procedure that dominates a long run. |
dump\<filename>\ |
Next to the program, created on every run. The intermediate output: the File Report (format detection, headers, imports, VB version), P-Code and IL listings, extracted images and icons, the QuickBASIC report. Safe to delete; it is rebuilt on the next run. Without /out, the project is written here too. |
VB4/5/6 and VB1–3 produce a Basic project. .NET produces the solution.
QuickBASIC produces a readable BASIC reconstruction and
QBReport.txt in the dump folder (there is no .vbp
for a DOS program). twinBASIC produces a compiling project with forms,
menus and real names. What each format gives back →
UPX-packed programs are detected and unpacked to a temporary copy automatically; the log says so. Other packers need a memory dump and the window's Decompile from Offset tool.
The command line calls exactly the code the window uses. A project generated headlessly is byte-for-byte what File ▸ Generate vbp writes.
No message boxes ever appear in command-line mode. The process returns one of these and closes, so a loop can branch on it.
| Code | Meaning | What to do |
|---|---|---|
| 0 | Success. The last line of decompile.log says what was processed and where the output went. | Nothing — move to the next file. |
| 1 | An error occurred while decompiling. | Read the message in decompile.log. If it is a format we should handle, report it with the log attached. |
| 2 | Input problem: no input file, file not found, or a switch that needs /out. | Fix the command line. |
| 3 | Not activated, this build is outside the license's update window, or the license is a single-computer one (the command line needs a site license). | See deploying the license. |
| 4 | /activate was refused — wrong key, device limit, or the server could not be reached. | The reason is in decompile.log. |
Copy, adjust the paths, run. Each recipe gives every program its own output folder so the projects never collide.
The basic call. Add /dism alongside /vbp to get the disassembly variant instead.
rem Windows batch file
cd /d "C:\Program Files (x86)\VB Source Code Recovery"
VBSourceCodeRecovery.exe "C:\Legacy\Inventory.exe" /out "C:\Recovered\Inventory" /vbp
if errorlevel 1 echo Recovery failed - see C:\Recovered\Inventory\decompile.log
The classic shelf-clearing loop. %%~nf is the file name without its extension, so Payroll.exe lands in C:\Recovered\Payroll.
rem recover-all.bat
@echo off
cd /d "C:\Program Files (x86)\VB Source Code Recovery"
for %%f in ("C:\Legacy\*.exe" "C:\Legacy\*.dll" "C:\Legacy\*.ocx") do (
echo Recovering %%~nxf ...
VBSourceCodeRecovery.exe "%%f" /out "C:\Recovered\%%~nf" /vbp
if errorlevel 1 echo FAILED: %%~nxf >> "C:\Recovered\failures.txt"
)
echo Done. Failures, if any, are listed in C:\Recovered\failures.txt
Reads the exit code and the last log line for each file and prints a table at the end — handy when the shelf has hundreds of programs.
# recover-all.ps1
$exe = 'C:\Program Files (x86)\VB Source Code Recovery\VBSourceCodeRecovery.exe'
$src = 'C:\Legacy'
$dest = 'C:\Recovered'
Set-Location (Split-Path $exe)
$results = foreach ($f in Get-ChildItem $src -Include *.exe,*.dll,*.ocx -Recurse) {
$out = Join-Path $dest $f.BaseName
$p = Start-Process -FilePath $exe -ArgumentList "`"$($f.FullName)`" /out `"$out`" /vbp" -Wait -PassThru -WindowStyle Hidden
$last = if (Test-Path "$out\decompile.log") { Get-Content "$out\decompile.log" -Tail 1 } else { '' }
[pscustomobject]@{ File = $f.Name; Exit = $p.ExitCode; Result = $last }
}
$results | Format-Table -AutoSize
$results | Export-Csv "$dest\summary.csv" -NoTypeInformation
VBSourceCodeRecovery.exe "C:\Libs\ReportEngine.dll" /out "C:\Recovered\ReportEngine" /solution
rem C:\Recovered\ReportEngine\ReportEngine.sln + a C# project + a VB.NET project
The built-in engine and DoDi's classic decompiler side by side, each in its own folder.
VBSourceCodeRecovery.exe "C:\Legacy\Ledger16.exe" /out "C:\Recovered\Ledger16-native" /vbp VBSourceCodeRecovery.exe "C:\Legacy\Ledger16.exe" /out "C:\Recovered\Ledger16-dodi" /vbp /dodi
With no generate switch the file is decompiled into its dump folder and nothing else is written — useful to triage a folder before deciding what to rebuild. The File Report tells you what built each program.
VBSourceCodeRecovery.exe "C:\Legacy\Unknown.exe" type "dump\Unknown.exe\FileReport.txt"
Each run writes its intermediate output to dump\<filename> next
to the program, so two simultaneous runs on files with the same name would tread
on each other. Keep a batch sequential — a typical native VB6 program takes
seconds to a few minutes — or give each parallel worker its own copy of the
install folder.
The command line is part of the site license, which covers every computer in your organization. Each machine is activated once; the program never needs internet access after that, and nothing you decompile is ever sent anywhere. Three ways to activate a machine, from hands-on to hands-off:
Start the program, open Help ▸ License…, paste the License Key from your order email and click Activate online. The command line works from then on. Offline machine? The same dialog shows a Device Code you can activate in your members area.
VBSourceCodeRecovery.exe /activate VBSR-XXXX-XXXX-XXXX-XXXX
activates the machine online and exits with 0. Exit 4
means it was refused; the reason is in decompile.log.
Issue an Activation Code for the machine's Device Code in the members
area, download it as license.dat, and place it next to
VBSourceCodeRecovery.exe. It is read before anything else, so an
install folder on a network share can carry the license for a team.
| Where the program looks for its license | Best for |
|---|---|
1. license.dat beside VBSourceCodeRecovery.exe | Silent deployment, shared install folders, build images |
2. %ProgramData%\VB Source Code Recovery\license.dat | One activation shared by every user of a machine |
3. %APPDATA%\VB Source Code Recovery\license.dat | Where online activation (options A and B) saves it, per Windows user |
Each code is bound to the Device Code of the computer it was issued for
and verified offline with a built-in key. To find a machine's Device Code
without opening the window, run /devcode and read
decompile.log.
Every version released while your updates are current keeps working
forever. A build released after your window closes returns exit
3 with the date, so a renewed or older build is a deliberate
choice, never a surprise mid-batch.
On a single-computer license the command line exits with 3
and a clear log line. Upgrade to a site license in your members area
to unlock it across the organization.
Every developer and every machine in your organization, the headless command line, and 12 months of updates and priority support. One flat price, delivered as a download the moment your order completes.