View Full Version : How to launch a bat file from custom action w/param from Progarm Files dir?

11-17-2014, 05:23 PM
Hi All;
I am having a little trouble. I have a custom action that launches a .bat file that I have been using for awhile in my installer. It has been running very well but I have been placing it in the TEMP folder. I now want to move it to our installation folder. The problem is I can't seem to get the quoting right for it. I am using the following to launch it.

C:\windows\system32\cmd.exe /k '"[INSTALLDIR]installConfigSyslogMan.bat" INSTALL'

The installdir equates to "C:\Program Files\Blah blah\". when I run the custom action I get this "The filename, directory name, or volume label syntax is incorrect." I have tried using the escape character and it tells me the same thing.

C:\windows\system32\cmd.exe /k "\"[INSTALLDIR]installConfigSyslogMan.bat\" INSTALL"

Any ideas?

11-25-2014, 06:12 AM
Can you not create a self-extracting exe (extracts to %temp% or another folder) (if security is an issue) that runs silently, and use that instead of the batch file as part of your custom action?
(7-zip, WinZip etc. can be used) (WinRAR is my favourite)

12-19-2014, 03:30 PM

Batch files can use environment variables. Try referencing %programfiles% in the batch file.

Recognized Environment Variables