Skip to content

Instantly share code, notes, and snippets.

@dzzie
Created January 1, 2023 14:06
Show Gist options
  • Save dzzie/3a03cbd6025a2a76eda50246be111896 to your computer and use it in GitHub Desktop.
Save dzzie/3a03cbd6025a2a76eda50246be111896 to your computer and use it in GitHub Desktop.
vb6 bulk compile
'bulk compile all vb6 project files in and below target directory
'requires a reference to vbdevkit library: http://sandsprite.com/tools.php?id=3
Sub Main()
On Error Resume Next
Dim exe As String, f() As String, ff, b
Dim fso As New CFileSystem2, c As New CCmdOutput
exe = "C:\Program Files (x86)\Microsoft Visual Studio\VB98\vb6.exe"
f() = fso.GetFolderFiles("C:\Users\home\Desktop\New folder\", "*.vbp", , True)
If UBound(f) < 1 Then Exit Sub 'error if no results will exit sub
For Each ff In f
b = fso.GetParentFolder(ff) & "\build_output.txt"
Debug.Print "Compiling: " & ff
Debug.Print c.GetCommandOutput(exe, "/make """ & ff & """ /out """ & b & """")
Debug.Print c.exitCode & " " & c.result 'exit code 1 = fail
Next
Debug.Print "Complete"
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment