views:

172

answers:

2

I'm trying to automate a VB6 build where different apps are built from the same source by:

  1. Changing "Conditional Compilation Arguments".
  2. "Make Project" to a different executable name.

I can do part of this on the command line:
VB6.EXE /m Project.VBP /d BUILD_OTHER_APP=1
but the executable still has the name "Project.exe". If I rename the .EXE it stops working (doesn't seem to run). VB6 doesn't seem to have a command line option to set the executable name and I can't get round this problem with renaming.

I'm using VB6 on Win7 32-bit.

+3  A: 

If you run VB6 /? from the command line a dialog box pops up to tell you all the options, and no, it seems that there isn't an option to specify the output filename.

I can't as yet see any reason for a rename to stop an executable working, but I'll try this later on today on Win XP.

The other workaround to renaming is to move the executables into folders of different names and create shortcuts or batch files of different names to call the correct executable.

edit: I'm working on Win XP and these two solutions are available to me:

  1. Rename the executable - You might be able to develop on XP and run on Win7?
  2. Add the .exe name to the build command line. This does override the .vbp:
    • VB6 /m Project1 /d conHello=-1 Hello.exe
    • VB6 /m Project1 /d conHello=0 World.exe
quamrana
Fantastic! Your second suggestion works perfectly, thanks.I don't understand the rename problem, but it happens for me in XP as well. I'm using different antivirus tools in each.
parsley72
+2  A: 

The hack that we are forced to do to create a different named output (and to change other aspects of the project) is to create a copy of the VBP (Project_tmp.vbp), and then change the name in the copy and build from that copy.

Kris Erickson