How can i initiate a windows task from a shortcut?

1

I've created 2 tasks in Task Scheduler on my Vista PC start uTorrent at 2am then close uTorrent (and shutdown PC) at 7am. However i'd like to only like this task to run if I've clicked a shortcut - ideally show something in the tray as well if possible. But not sure how?

rich

Posted 2009-09-10T11:53:50.330

Reputation:

Answers

2

uTorrent has scheduling built in.

You could therefore do the following:

  1. Setup uTorrent to only be active between 2am and 7am.

  2. Set up a scheduled task to shut the PC down at 7:10am (to give yourself some leeway). From your question I'm assuming that you don't normally leave your computer on 24/7.

  3. You can then just start uTorrent normally when you have something to download, it will operate between 2am and 7am and then your PC will shut down 10 minutes later.

I should add that uTorrent can cope with the PC shutting down while it's still running, so you could get away without a delay between the end of uTorrent's active time and the machine shutting down.

ChrisF

Posted 2009-09-10T11:53:50.330

Reputation: 39 650

0

Set up a batch file using the AT command, like so:

AT 2:00 "[path]/utorrent.exe"

AT 7:00 "shutdown /s /f"

Roger

Posted 2009-09-10T11:53:50.330

Reputation: 1 407

0

You can control your scheduled tasks using schtasks console command. So you may create a task performing on system start-up disabling you tasks with something like that in .bat file:

schtasks /Change /DISABLE /TN "Start uTorrent"
schtasks /Change /DISABLE /TN "System shutdown"

And then you may create a shortcut to another .bat file enabling tasks once clicked, like:

schtasks /Change /ENABLE /TN "Start uTorrent"
schtasks /Change /ENABLE /TN "System shutdown"

PS. And it should wake up your computer from sleep if you specified to do so in scheduled tasks, but it could be put to sleep again after some user-inactivity timeout.

Regent

Posted 2009-09-10T11:53:50.330

Reputation: 1 586