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
- :
- Parameter not passed to cmd.exe in LaunchAppAndWait
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
‎Jun 25, 2008
07:59 AM
Parameter not passed to cmd.exe in LaunchAppAndWait
I am working with a Basic MSI project and I am trying to schedule a windows task through the installer. I am using the DOS "schtasks" command. Here is the call that I am using for the same:
LaunchAppAndWait ( "cmd.exe", "schtasks /Create /SC WEEKLY /D "+svTaskDay+" /ST "+svTaskHr+":"+svTaskMin+":00 /TN \"Update XPS\" /TR "+szProgram, WAIT);
svTaskDay is a variable that collects the day from the user, scTaskHr and svTaskMin have the time in hour and min as entered by the user. szProgram has the path to the file that I want to execute.
While this command works fine from the command prompt, it is not working from InstallShield. The command prompt is invoked but the parameters specified are not passed. Any thoughts on this is welcome.
I am building installer for Windows XP and Windows 2003.
LaunchAppAndWait ( "cmd.exe", "schtasks /Create /SC WEEKLY /D "+svTaskDay+" /ST "+svTaskHr+":"+svTaskMin+":00 /TN \"Update XPS\" /TR "+szProgram, WAIT);
svTaskDay is a variable that collects the day from the user, scTaskHr and svTaskMin have the time in hour and min as entered by the user. szProgram has the path to the file that I want to execute.
While this command works fine from the command prompt, it is not working from InstallShield. The command prompt is invoked but the parameters specified are not passed. Any thoughts on this is welcome.
I am building installer for Windows XP and Windows 2003.
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 25, 2008
08:55 AM
Try storing the parameter in a string variable before the LaunchAppAndWait call. Also try printing out the string in a MessageBox and verify the quotes are as expected. If the quotes are not correct, use the LongPathToQuote function.
Also the "/" symbol would ignore the next character....check if that is the case....
Also the "/" symbol would ignore the next character....check if that is the case....
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 25, 2008
09:03 AM
It probably doesn't matter, but you should also be able to launch schtasks.exe directly, instead of going through cmd.exe...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 26, 2008
12:53 AM
I have tried saving the parameter in a string and printing the value also. The command is perfect. Somehow the parameter is not getting passed. Even a simple dir command is not passed.
I cannot execute schtasks directly. With cmd.exe the command prompt appears, but if I try running schtasks directly, nothing appears
I cannot execute schtasks directly. With cmd.exe the command prompt appears, but if I try running schtasks directly, nothing appears
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 08, 2008
04:13 AM
rajeevshukla wrote:
I have tried saving the parameter in a string and printing the value also. The command is perfect. Somehow the parameter is not getting passed. Even a simple dir command is not passed.
I cannot execute schtasks directly. With cmd.exe the command prompt appears, but if I try running schtasks directly, nothing appears
Do you have tried the following:
"cmd.exe /c", "schtasks /Create /SC WEEKLY /D "+svTaskDay+" /ST "+svTaskHr+":"+svTaskMin+":00 /TN \"Update XPS\" /TR "+szProgram, WAIT);
this woud call the program within a cmd interpreter session and then it shoud work
if not there is also the possibility to handle the whole with the help of a custom action
see screenshot attached of an example how to configure the custom action
as you can see the command (schtasks in your case) is beetween two brackets this method is very handy
to call system specific command within the cmd interpreter while the setup process is running
and don't forget to set the condition "Not Installed" or the Custom Action will also be called while uninstalling the app!