cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
shawn_eckley
Level 3

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

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?
Labels (1)
0 Kudos
(2) Replies
SGSlavendea
Level 4

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)
0 Kudos
GrantK
Level 7

Hi,

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

Recognized Environment Variables
http://technet.microsoft.com/en-us/library/dd560744%28v=ws.10%29.aspx

Grant
0 Kudos