cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ozzie_marquez
Level 2

Cannot run a .bat file from my InstallScript project

I cannot run .bat file from my InstallScript. I have tried several suggestions, but none have worked.
I am using the following to launch it:

szPath = "C:\\";
ChangeDirectory (szPath);
LaunchAppAndWait ( szPath^"CATLevel.bat", "", LAAW_OPTION_WAIT );

I am executing it in function OnFirstUIBefore()

This CATLevel.bat file works fine when run from a CMD window on XP.

What am I doing wrong? Should I be using some other tool to run it?
Labels (1)
0 Kudos
(2) Replies
deramor
Level 6

First, it looks like you are trying to run your bat file from c:\CATLevel.bat. Is this true? At the time this script is executed, does the file exist? I make sure, I would place a message box on the line preceding the launchappandwait call and then navigate to c:\ and check for your file.

What kind of project type is this? From your reference of OnFirstUIBefore I suspect InstallScript or InstallScript MSI.
0 Kudos
ozzie_marquez
Level 2

Thank you very much. You were right on. I build the .bat file in the script, but failed to close the file when done. That is why it would not run. I feel kind of dumb about this. So, I added the CloseFile (nvFileHandle) statement prior to running LaunchAppAndWait and now it works fine. And yes, it is an InstallScript project.

Thanks
0 Kudos