easyrider666
Posts: 3
Joined: Mon Jul 03, 2006 2:27 pm

Scheduled tasks

Hi just wondering if scheduled tasks can be installed.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

What exactly you mean with scheduled tasks, please give me more details.

Regards,
Gigi
_________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
easyrider666
Posts: 3
Joined: Mon Jul 03, 2006 2:27 pm

basicaly i have a program which needs to run every day and I going to use scheduled tasks in windows to do this. I was wondering if its possible to have it automatically installed as a scheduled task.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

Here is VBS script that create a scheduled task to start "Notepad.exe" at 12:30 PM every Monday, Wednesday, and Friday. Create a .vbs file and add "New Attached Custom Action" in Advances Installer.

Code: Select all

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewJob = objWMIService.Get("Win32_ScheduledJob")
errJobCreated = objNewJob.Create _
("Notepad.exe", "********123000.000000-420", _
True , 1 OR 4 OR 16, , , JobID)
You need to modify this script to correspond with your needs.

Regards,
Gigi
__________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
easyrider666
Posts: 3
Joined: Mon Jul 03, 2006 2:27 pm

Hi thanks for that, I will try this, also is it possible to get the selected directory from the user install and pass it into the vbs file?

Thanks
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
also is it possible to get the selected directory from the user install and pass it into the vbs file?
Yes you can acces a property in the script file with the following vbs code line:

Code: Select all

Session.Property("APPDIR")
Regards,
Gigi
_________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Feature Requests”