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
- :
- Batch file for Schedule Tasks
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
‎Jan 18, 2011
09:45 AM
Batch file for Schedule Tasks
I have got a file in my installation that needs to be set as a scheduled task. I have written a sample batch file that will set a scheduled task to lauch the calculator..
This works fine, but because the file I want it to run is installed with the applciation, and because this location can be declared by the user I have a headache.
How do I get the task to run from [INSTALLDIR]Folder\Task.exe?
[CODE]schtasks.exe /create /sc daily /tn "ScheduledTask" /tr [INSTALLDIR]Folder\Task.exe /st 14:15[/CODE]
~
I am ok to get a batch file running, I just dont know how to get the value of INSTALLDIR into the batch file.
schtasks.exe /create /sc daily /tn "calculator" /tr c:\windows\system32\calc.exe /st 14:15
This works fine, but because the file I want it to run is installed with the applciation, and because this location can be declared by the user I have a headache.
How do I get the task to run from [INSTALLDIR]Folder\Task.exe?
[CODE]schtasks.exe /create /sc daily /tn "ScheduledTask" /tr [INSTALLDIR]Folder\Task.exe /st 14:15[/CODE]
~
I am ok to get a batch file running, I just dont know how to get the value of INSTALLDIR into the batch file.
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 18, 2011
12:24 PM
A text file content replacement functionality in IS might be helpful.
worth a try
worth a try
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 21, 2011
03:45 PM
Could you run the executable directly instead of going through a batch file? If so, you can easily pass [INSTALLDIR] or other properties to be expanded into the command.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 24, 2011
04:17 AM
Sorry Robert that has gone a little over my head at this point, I will have to do some more reading and then look at this issue again. I will look into using text replacment and going through an executable that can be passed [INSTALLDIR] and post my methods here when I understand a little more.
Thanks
Thanks
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 24, 2011
10:23 AM
EDIT:
I have got a text file changes setting to alter %INSTALLDIR% to the [INSTALLDIR] value, and have now got this altering the text in the batch file by placing the file in include files, and match whole word set to no (as i know that %installdir% will not appear anywhere else).
All working now. Thanks for helping both.
I have got a text file changes setting to alter %INSTALLDIR% to the [INSTALLDIR] value, and have now got this altering the text in the batch file by placing the file in include files, and match whole word set to no (as i know that %installdir% will not appear anywhere else).
schtasks.exe /create /sc daily /tn "ScheduledTask" /tr %INSTALLDIR%Folder\Task.exe /st 14:15
All working now. Thanks for helping both.