Batch files on Setup Project
-
How to execute a batch file on the a deployment project? I tried the custom option and it's telling that .bat is not a valid file type. Please help.
-
How to execute a batch file on the a deployment project? I tried the custom option and it's telling that .bat is not a valid file type. Please help.
Instead of using a batch file, it has only a limited set of commands, it is far far better to use a more general scripting language for custom, pre and post build steps. I use biterScripting for this. For example, when building a deployable release, we copy certain important modules suffixed by the build time. I stored the following script into a file postbuild.txt. # Get build time var str build_time set $build_time = gettime() # Copy file (for example) buildparms.h var str file var str build_file set $file = "buildparms.h" set $build_file = $file + "_" + $build_time cat $file > { echo $build_file } # etc. This script is in file postbuild.txt. I then enter the following in the post-build steps in Visual Studio. "C:/biterScripting/biterScripting.exe" "postbuild.txt" That does it for me. You can put tons of code in the postbuild.txt script, and you can even call other (sub-) scripts from that script. We even build all the help files in the pre-build using the same approach. If you are not using biterscripting yet, you can get it free at biterscripting.com. If you already know batch commands, you will know biterscript in no time at all. Hope this helps. Patrick