kodius Posted April 24, 2009 Share Posted April 24, 2009 RunWait("schtasks /create /RU "username" /RP" & $user_password_input & "/TN "System Cleanup" /TR ""C:\Progra~1\ccleaner\ccleaner.exe" /AUTO" /SC daily /ST 19:30:00") Link to comment Share on other sites More sharing options...
martin Posted April 24, 2009 Share Posted April 24, 2009 RunWait("schtasks /create /RU "username" /RP" & $user_password_input & "/TN "System Cleanup" /TR ""C:\Progra~1\ccleaner\ccleaner.exe" /AUTO" /SC daily /ST 19:30:00")PossiblyRunWait('schtasks /create /RU "username" /RP' & $user_password_input & '/TN "System Cleanup" /TR "C:\Progra~1\ccleaner\ccleaner.exe" /AUTO /SC daily /ST 19:30:00')but who knows because I have no idea what schtasks is and your post is not exactly, er, verbose To get it correct I think you should do thisGet what you want at the command prompt. Save that command line.The use ConsoleWrite instead of RunWait and chnage it untill it gives the same as the command that worked at the command prompt. Then change ConsoleWrite for RunWait. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
kodius Posted April 25, 2009 Author Share Posted April 25, 2009 PossiblyRunWait('schtasks /create /RU "username" /RP' & $user_password_input & '/TN "System Cleanup" /TR "C:\Progra~1\ccleaner\ccleaner.exe" /AUTO /SC daily /ST 19:30:00')but who knows because I have no idea what schtasks is and your post is not exactly, er, verbose To get it correct I think you should do thisGet what you want at the command prompt. Save that command line.The use ConsoleWrite instead of RunWait and chnage it untill it gives the same as the command that worked at the command prompt. Then change ConsoleWrite for RunWait.schtask schedules Windows XP, Vista, 2003, 2008 tasks. I'm trying to schedule ccleaner to run once a day and cleanup userland garbage after they leave for the day to keep the PCs clean.I just can't seemt o get the syntax write... Has anyone used schtask with ccleaner, it's the $user_password_input I'm troubled by? Link to comment Share on other sites More sharing options...
Flash1212 Posted April 25, 2009 Share Posted April 25, 2009 (edited) schtask schedules Windows XP, Vista, 2003, 2008 tasks. I'm trying to schedule ccleaner to run once a day and cleanup userland garbage after they leave for the day to keep the PCs clean. I just can't seemt o get the syntax write... Has anyone used schtask with ccleaner, it's the $user_password_input I'm troubled by? I've done a bit of task scheduling at my job. I believe that like /RU /RP requires a space before the actual value. Notice the space in /RP ' also the space before /TN. RunWait('schtasks /create /RU "username" /RP ' & $user_password_input & ' /TN "System Cleanup" /TR "C:\Progra~1\ccleaner\ccleaner.exe" /AUTO /SC daily /ST 19:30:00') Alternative the system account can easily take care of this task. RunAs($Username, @ComputerName, $Password,0,'schtasks.exe /create /ru system /tn "System Cleanup" /sc Daily /st 19:30:00 /tr "C:\Progra~1\ccleaner\ccleaner.exe"', 'c:\WINDOWS\system32\', @SW_HIDE) Hope this helps. Edited April 25, 2009 by Flash1212 **The only limit is what you believe they tell you it is** Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now