Here is a tip to automate your post compile process in Visual Basic 6.

First locate the link.exe file inside the VB6 directory in Program Files. Make a copy of this file and name it link60.exe Create a new project, in the form_load sub read the command line into a string and split it by space, ie:

Private Sub Form_Load()
  Dim strIn as String, spl() as String, thisCMD as String
  strIn = Command$()
  Shell App.Path & "\link60.exe " & strIN, vbHide
  spl = Split(neCmd, Chr(34) & " " & Chr(34))
  thisCMD = ReadINIFile(ExtractDirName(spl(1)) & "\build.ini", "Run", "After", "")
  If len(thisCMD) > 0 Then
    Shell thisCMD
  End If
  End
End Sub

We also read from an ini file named build.ini, it looks like this:

[Run]
After=make_a_script.cmd

You must place this file into the location where you intend to build your program. Inside of make_a_script.cmd we can automate any task you can imagine. GIT, UPX, FTP, etc. Now when you are happy with the function of the test program, compile it as “link.exe”. Copy it over the existing link.exe and now attempt to compile something. After the compile process has finished your script will run.

Here is an snippet of one of my post-build scripts.

echo Issue git commit?
choice
if %errorlevel%==2 goto :askftp
if %errorlevel%==1 goto :dogit
goto :askftp

:dogit
cls
git commit -a
git status
pause


:askftp
echo Upload files to ftp?
choice
if %errorlevel%==2 goto :donne
if %errorlevel%==1 goto :doftp
pause
goto :donne

One last tip, if you have a large project and it takes a long time to build you can speed up this process by using a RAM disk. I use a program called Radeon RAM disk and I make a 4 GB ram drive as letter X:, I have a build folder on this drive and when I compile I make sure to compile on that drive. The files that are created on disk are now created in ram and the entire process is considerably quicker. If you have an SSD you can still benefit from the speed increase as your RAM will outperform your SSD.

Software for RAM disk: http://memory.dataram.com/products-and-services/software/ramdisk

Contact me if you need clarification, some bits of this post are not explained in detail. While I show using Shell I actually use a function named ExecCmdAndWait in order to delay further execution until the link60.exe is completed.