Scheduled Task Functions? - Advanced Installer Community
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Scheduled Task Functions?

Hello,

I want to do these three things in the Scheduled Task,

1). Run even if the user is not logged in. However, this asks to enter the user account password. How to bypass this (make it run without asking the password) or is there a way to get the username and password in the computer and apply them to the task?

2). How to wake the computer to run the task?

3). How stop the task if it runs longer than two hours?

How to apply these settings please?

:?:
K
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Scheduled Task Functions?

Hello K,
1). Run even if the user is not logged in. However, this asks to enter the user account password. How to bypass this (make it run without asking the password) or is there a way to get the username and password in the computer and apply them to the task?
I'm afraid that this is not possible from a security point of view. You could however prompt the user to insert the logon information on a custom dialog, store it in properties and use these in your scheduled task.
2). How to wake the computer to run the task?
Advanced Installer doesn't support this behaviour. However you could implement this using a custom action. Please take a look on this StackOverflow topic: Using schtasks from the command line, what parameter will wake the computer from sleep and execute the task
3). How stop the task if it runs longer than two hours?
You could implement this behaviour using your own custom action as well. Please take a look on this StackOverflow topic : Stop a Windows Task Scheduler task after a certain time

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: Scheduled Task Functions?

Thank you.

:)
K
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Scheduled Task Functions?

Hello,

You are welcome. Please let me know if you have any other questions.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: Scheduled Task Functions?

Hello,

I created the Schedule Task and exported it as XML file. Then added this code in the Custom Action: VBScript,

Code: Select all

on error resume next
Set wShell = CreateObject ("Wscript.Shell")
wShell.Run "SchTasks /Create /TN ""Task Name"" /XML ""C:\Task.xml"" /F", 0
K
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Scheduled Task Functions?

Hello K,

Thank you for the follow up and for posting your solution. I'm sure it will be helpful for other users as well.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: Scheduled Task Functions?

OK
K
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Scheduled Task Functions?

Hello,

Please let us know if you have any other questions.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Codename K
Posts: 479
Joined: Fri Jan 29, 2010 3:04 pm

Re: Scheduled Task Functions?

I will. Thank you. :)
K

Return to “Common Problems”