AutoHotkey Community

It is currently May 26th, 2012, 5:23 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: April 7th, 2008, 12:22 am 
Offline

Joined: September 10th, 2006, 1:41 pm
Posts: 157
Hi,

i got a problem, i dont know how to add in Scheduled Tasks to start an application with command line parameter...

the code below wont work because it adds fullpath and command line parameter without quote marks which are needed.

Now:
Code:
C:\Documents and Settings\DJ_Anonimo\Desktop\New AutoHotkey Script (2).exe 1


Correct:
Code:
"C:\Documents and Settings\DJ_Anonimo\Desktop\New AutoHotkey Script (2).exe" 1

so the command line parameter is not quoted with quote marks and thats correct.


Code:
if 1 = 1
{
Msgbox Command line
ExitApp
}

Sch_Time := "00:00:00"
SCh_UserName  := "A"             
SCh_Password  := "A"             
SCh_Domain := A_ComputerName                   
ScriptFullPathWithCmdline = %A_ScriptFullPath% 1

Task1 = SCHTASKS.exe /Create /SC weekly /D MON,TUE,WED,THU,FRI /TN ScheduledTask /ST 00:00:00 /TR "%ScriptFullPathWithCmdline%" /RU

%SCh_Domain%\%SCh_UserName% /RP %SCh_Password%

Run, %Task1%


Anyone have some experiences with WinXp "Scheduled Tasks" ?

Thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 7th, 2008, 1:13 am 
Offline

Joined: March 11th, 2008, 11:36 pm
Posts: 291
when perform command line tools.
use %Comspec% instead of perform directly

Code:
Run, %ComSpec% /c %Task1%

/c for autoclose
/k for keep window


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 7th, 2008, 1:26 am 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
Scheduled Tasks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 7th, 2008, 3:56 pm 
Offline

Joined: September 10th, 2006, 1:41 pm
Posts: 157
ok thanks but anyway i dont know how to create a task schedule with a command line parameter.

any ideas ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2008, 11:12 pm 
Offline

Joined: September 10th, 2006, 1:41 pm
Posts: 157
Problem solved with a microsoft workaround

http://support.microsoft.com/kb/823093


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Alpha Bravo, Bing [Bot], Google [Bot], mrhobbeys, rbrtryn, Yahoo [Bot] and 65 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