AutoHotkey Community

It is currently May 27th, 2012, 11:34 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: August 23rd, 2005, 1:30 am 
Offline

Joined: August 23rd, 2005, 1:24 am
Posts: 2
Location: Irvine, CA
:?: My apologies if this has been answered, and I just didn't get it, but I haven't seen a clear answer:
How can you use Windows Scheduler to initiate an AHK macro? :?:

_________________
Philippe Tusler


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 23rd, 2005, 6:18 am 
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/schtasks.mspx
That URL has lots of great information on schtasks, which replaces the AT command.

Anyway, something like this:
schtasks /create /tn "My Script" /tr "c:\program files\AutoHotkey\autohotkey.exe c:\script.ahk" /sc onidle /i 60 /ru ""

That would cause the script in the root of the C: drive to run when the machine has been idle for 60 minutes. /ru "" causes it to run under the system account, which prevents anything from showing up -- it becomes a background task. Otherwise use /ru "myusername" /rp "mypassword".

The above URL documents how to schedule your task however you would like.


Report this post
Top
  
Reply with quote  
PostPosted: August 23rd, 2005, 6:14 pm 
Offline

Joined: August 23rd, 2005, 1:24 am
Posts: 2
Location: Irvine, CA
I guess I need to express myself more clearly: How do I get the script to actually execute without being forced to enter a triggering keysequence?

_________________
Philippe Tusler


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 23rd, 2005, 6:46 pm 
Hi,
It is always nice to make yourself clear. Because we can't read other users minds. What is that you want to do?

From what you wrote I guess:
You want to execute a script without using a key combination.
Your title suggest you want to use the Windows Scheduler. The guest showed a way to execute it with a scheduler. But form your last post I guess you didn't want that information. So what is left?

To execute a AHK script without a keysequence:
- Double click it in the explorer
- put it into the autostart folder of your windows OS
- have a second script start it at a given time or period
- use the GUI of the windows scheduler to have it scheduled
- use any other scheduler, you'll find several on the net

What do you want to do? Let us know. I'm sure we will be better in helping you then we are in mindreading. Thanks.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 10th, 2006, 4:00 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Anonymous wrote:
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/schtasks.mspx
That URL has lots of great information on schtasks, which replaces the AT command.

Anyway, something like this:
schtasks /create /tn "My Script" /tr "c:\program files\AutoHotkey\autohotkey.exe c:\script.ahk" /sc onidle /i 60 /ru ""

That would cause the script in the root of the C: drive to run when the machine has been idle for 60 minutes. /ru "" causes it to run under the system account, which prevents anything from showing up -- it becomes a background task. Otherwise use /ru "myusername" /rp "mypassword".

The above URL documents how to schedule your task however you would like.
Thanks Guest for this info. I had a closer look at SchTasks, it is very powerful, but you need to have admin rights to use it :(
from the end of that page wrote:
The user must be a member of the Administrators group on the computer that the command affects.

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
PostPosted: January 11th, 2006, 5:00 am 
Offline

Joined: December 20th, 2005, 4:15 am
Posts: 165
Location: Malaysia
tintinmilou wrote:
:?: My apologies if this has been answered, and I just didn't get it, but I haven't seen a clear answer:
How can you use Windows Scheduler to initiate an AHK macro? :?:


I assume you're refering to "Scheduled Tasks" in Windows XP? If so, it is fairly simple.

Scheduled Tasks will run any program, if you have the proper rights. So all you need to do is to compile your AHK script into an EXE file (i.e. a program).

After that you only need to drag the EXE file into the Scheduled Tasks folder, and set the schedule. You'll have to make sure the user name and password are correct, or it won't run. They are under "Run as" and "set password".


Report this post
Top
 Profile  
Reply with quote  
 Post subject: schtasks
PostPosted: April 21st, 2007, 8:33 pm 
I am getting the no account information error on SCHTASKS even on a local machine. any ideas what is causing it?


Report this post
Top
  
Reply with quote  
PostPosted: April 22nd, 2007, 8:50 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Lemming wrote:
So all you need to do is to compile your AHK script into an EXE file (i.e. a program).
Well, I successfully ran uncompiled scripts too...

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject: same task issue
PostPosted: May 14th, 2007, 10:09 pm 
Vista Business Ed...

I am having the same issue.
I have local admin rights w/ UAC turned off.
I recorded a repeptitive task.
The task was then compiled to an exe and setup to run 4 times a day.

I try running the task on the given time or manually and nothing happens.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 17 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