| View previous topic :: View next topic |
| Author |
Message |
jak
Joined: 28 Feb 2006 Posts: 159
|
Posted: Fri Jul 24, 2009 2:48 am Post subject: how to pause windows scheduled tasks? |
|
|
There are directions here on how to go to the scheduled tasks folder in winXP and on the menu click "advanced>pause scheduled tasks".
How can I automate that in autohotkey? (ie, is there a single line I can send to the command prompt?)
I want to pause/unpause my scheduled tasks when playing games or watching movies... I searched the forum but didnt see a command line or script that could be run with a hotkey... wondering if its possible with autohotkey to create that...
thanks! |
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 2926 Location: The Shell
|
Posted: Fri Jul 24, 2009 8:20 am Post subject: |
|
|
Not sure if you can pause from here but Scheduled Tasks can be run from compsec.
| Code: | | Run %comspec% /k SCHTASKS |
If you cant do it from there pause it directly, run from the built in class.
| Code: | Run ::{d6277990-4c6a-11cf-8d87-00aa0060f5bf},,
WinWait, Scheduled Tasks ahk_class CabinetWClass,
msgbox, Scheduled Tasks are open!`n`nNow add pause command. |
Once you get it perfected you can (I think) add a Hide to the 3rd parameter of Run (sorry I dont use Scheduled Tasks).
hth _________________
paradigm.shift:=(•_•)┌П┐RTFM||^.*∞ |
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 3113 Location: MN, USA
|
Posted: Fri Jul 24, 2009 3:29 pm Post subject: |
|
|
You may also start and stop the service itself. | Code: | ;stop
Run, %comspec% /c net stop "Task Scheduler",,Hide
;start
Run, %comspec% /c net start "Task Scheduler",,Hide |
|
|
| Back to top |
|
 |
jak
Joined: 28 Feb 2006 Posts: 159
|
Posted: Fri Jul 24, 2009 4:21 pm Post subject: |
|
|
thanks guys.
too bad I cant send
| Code: | | Run, %comspec% /c net pause "Task Scheduler",,Hide |
|
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 3113 Location: MN, USA
|
Posted: Fri Jul 24, 2009 5:37 pm Post subject: |
|
|
| It looks like the SC command can pause and continue a service, though I've never tried it. |
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 2926 Location: The Shell
|
Posted: Fri Jul 24, 2009 5:51 pm Post subject: |
|
|
| jaco0646 wrote: | You may also start and stop the service itself. | Code: | ;stop
Run, %comspec% /c net stop "Task Scheduler",,Hide
;start
Run, %comspec% /c net start "Task Scheduler",,Hide |
|
omg another one overlooked! I will be sllllooowwwly crawling through MS commands now
Thanks for that one jaco0646
| jaco0646 wrote: | | It looks like the SC command can pause and continue a service, though I've never tried it. | GOLD I SAY GHOOOLLLD!
 _________________
paradigm.shift:=(•_•)┌П┐RTFM||^.*∞ |
|
| Back to top |
|
 |
jak
Joined: 28 Feb 2006 Posts: 159
|
Posted: Fri Jul 24, 2009 6:26 pm Post subject: |
|
|
This script is working well. I modelled it on the "disable screen saver" script that I found on the forums here.
Save the following to an ".ahk" file. Run that file when you want to pause your windows scheduled tasks. A system tray icon will appear while the tasks are paused. To unpause, just right click that icon and exit the ahk script.
Thats similar to how the 'disable screen saver' ahk script works. Of course you can modify this to work on a hotkey instead, if you want. (I prefer it as a separate script cuz I use a command line "launchy" style program to launch it).
| Code: | ;Pause Scheduled Tasks.ahk
#Persistent
Menu, Tray, Icon, shell32.dll, 110
Menu, Tray, Tip, Scheduled Tasks Paused!!!
OnExit, ContinueTasks
;pause
Run, %comspec% /c net pause "Task Scheduler",,Hide
Return
ContinueTasks:
;continue
Run, %comspec% /c net continue "Task Scheduler",,Hide
ExitApp
Return |
Last edited by jak on Fri Jul 24, 2009 7:40 pm; edited 1 time in total |
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 2926 Location: The Shell
|
|
| Back to top |
|
 |
|