cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
shawn_eckley
Pilgrim

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
Flexera beginner

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

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
Pilgrim

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

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