AutoHotkey Community

It is currently May 26th, 2012, 8:19 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: July 24th, 2009, 3:48 am 
Offline

Joined: February 28th, 2006, 8:42 am
Posts: 159
There are directions hereon 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!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 24th, 2009, 9:20 am 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
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

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 24th, 2009, 4:29 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 24th, 2009, 5:21 pm 
Offline

Joined: February 28th, 2006, 8:42 am
Posts: 159
thanks guys.

too bad I cant send

Code:
Run, %comspec% /c net pause "Task Scheduler",,Hide


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 24th, 2009, 6:37 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
It looks like the SC command can pause and continue a service, though I've never tried it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 24th, 2009, 6:51 pm 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
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.
:shock: :shock: GOLD I SAY GHOOOLLLD!
Image

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 24th, 2009, 7:26 pm 
Offline

Joined: February 28th, 2006, 8:42 am
Posts: 159
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 July 24th, 2009, 8:40 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 24th, 2009, 8:35 pm 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
Nice work jak!

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Pulover, SifJar, SKAN, StepO and 57 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group