This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Cannot run a .bat file from my InstallScript project
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 30, 2011
01:49 PM
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?
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?
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 30, 2011
02:35 PM
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.
What kind of project type is this? From your reference of OnFirstUIBefore I suspect InstallScript or InstallScript MSI.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 30, 2011
03:41 PM
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
Thanks
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)