Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Scheduling schtasks

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,49080
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Scheduling schtasks
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Scheduling schtasks - 7/5/2007 5:26:06 AM   
  Xaneth


Posts: 14
Score: 0
Joined: 4/10/2007
Status: offline
I'm using a script for a universal login I found on this site that works really well.  Recently, I've been asked to set up and schedule cleanmgr.exe to clean the disk as well as defrag.  When I added it like so:


      

It threw the error:



I found in an MS newsgroup posting, that if you use double quotes, it allows you to pass commands with spaces in it, such as the file's pathname, like so:


      

Then on the client, I get "invalid switch /f" on the defrag schedule and "invalid switch /sagerun:64" on the cleanmgr schedule.  How to go about doing this without error?  
 
 
Post #: 1
 
 RE: Scheduling schtasks - 7/5/2007 7:56:55 AM   
  dm_4ever


Posts: 2635
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
What if you try this...


      

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Xaneth)
 
 
Post #: 2
 
 RE: Scheduling schtasks - 7/5/2007 5:57:37 PM   
  aru1683

 

Posts: 25
Score: 0
Joined: 7/1/2007
From: India
Status: offline
this is the code i modified from the above. its is not giving any error. but the task is not getting accomplished. where i went worng?

set WshShell=CreateObject("wscript.shell")
WshShell.Run "schtasks /create /ru arumugam_n/rp hello123/sc daily /tn Defrag /tr"& "C:\Documents and Settings\Arumugam_n\Desktop\vb scrpits\date.vbs" &" -f /st 12:20:00 /f"
wscript.echo Err.Number

script explanation:

scheduling a task to run a date.vbs daily at 12.20 pm . run as Arumugam_n and password of my system hello123 i have provided in the parameter section. why it is not running.? somebody help me pls

(in reply to dm_4ever)
 
 
Post #: 3
 
 RE: Scheduling schtasks - 7/6/2007 12:42:37 AM   
  dm_4ever


Posts: 2635
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
The example you posted would require extra quotes if you read the "Frequently Asked Stuff" post you would have seen this.



      

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to aru1683)
 
 
Post #: 4
 
 RE: Scheduling schtasks - 7/6/2007 1:30:07 AM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
How are you going to run sagerun:64 without performing a sageset? Is there somthing I'm missing? and in sageset is where you select your options of what you would like cleaned. I dont see this being possible on client machines.
The way I done it was to write the registry values, obviously mine are 65 but you can use any number

e.g.


      

(in reply to dm_4ever)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Scheduling schtasks Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts