

InterviewSolution
Saved Bookmarks
1. |
Solve : script runs every x hours everyday? |
Answer» <html><body><p>Hi,<br/><br/>I was wondering if I can get some help here.<br/><br/>I am trying to write a vbscript that can perform file <a href="https://interviewquestions.tuteehub.com/tag/transfer-246431" style="font-weight:bold;" target="_blank" title="Click to know more about TRANSFER">TRANSFER</a> to an external hard drive that is attached to the PC directly. Also, I want this script to run every half an hour everyday. I am looking for some help from anyone who might be able to help me here.<br/><br/>PC runs on XP Pro.<br/><br/>Any help would be greatly appreciated.<br/><br/>Thank you in advance<br/><br/>schtasks /?<br/><br/>SCHTASKS /parameter [arguments]<br/><br/>Description:<br/> Enables an administrator to create, delete, query, change, run and<br/> end scheduled tasks on a local or remote system.<br/><br/>Parameter List:<br/> /Create Creates a new scheduled task.<br/><br/> /Delete Deletes the scheduled task(s).<br/><br/> /Query Displays all scheduled tasks.<br/><br/> /Change Changes the properties of scheduled task.<br/><br/> /Run Runs the scheduled task on demand.<br/><br/> /End Stops the currently running scheduled task.<br/><br/> /ShowSid Shows the security identifier corresponding to a scheduled task name.<br/><br/> /? Displays this help message.<br/><br/>Examples:<br/> SCHTASKS<br/> SCHTASKS /?<br/> SCHTASKS /Run /?<br/> SCHTASKS /End /?<br/> SCHTASKS /Create /?<br/> SCHTASKS /Delete /?<br/> SCHTASKS /Query /?<br/> SCHTASKS /Change /?<br/> SCHTASKS /ShowSid /?<br/>SCHTASKS.EXE /CREATE /? <br/><br/><br/><br/>SCHTASKS /Create [/S system [/U username [/<a href="https://interviewquestions.tuteehub.com/tag/p-236832" style="font-weight:bold;" target="_blank" title="Click to know more about P">P</a> [password]]]]<br/> [/RU username [/RP password]] /SC schedule [/MO modifier] [/D day]<br/> [/M months] [/I idletime] /TN taskname /TR taskrun [/ST starttime]<br/> [/RI interval] [ {/ET endtime | /DU duration} [/K] [/XML xmlfile] [/V1]]<br/> [/SD startdate] [/ED enddate] [/IT | /NP] [/Z] [/F]<br/><br/>Description:<br/> Enables an administrator to create scheduled tasks on a local or<br/> remote system.<br/><br/>Parameter List:<br/> /S system Specifies the remote system to connect to. If omitted<br/> the system parameter defaults to the local system.<br/><br/> /U username Specifies the user context under which SchTasks.exe<br/> should execute.<br/><br/> /P [password] Specifies the password for the given user context.<br/> Prompts for input if omitted.<br/><br/> /RU username Specifies the "run as" user account (user context)<br/> under which the task runs. For the system account,<br/> valid values are "", "NT AUTHORITY\SYSTEM"<br/> or "SYSTEM".<br/> For v2 tasks, "NT AUTHORITY\LOCALSERVICE" and<br/> "NT AUTHORITY\NETWORKSERVICE" are also available as well<br/> as the well known SIDs for all three.<br/><br/> /RP [password] Specifies the password for the "run as" user.<br/> To prompt for the password, the value must be either<br/> "*" or none. This password is ignored for the<br/> system account. Must be combined with either /RU or<br/> /XML switch.<br/><br/> /SC schedule Specifies the schedule frequency.<br/> Valid schedule types: MINUTE, HOURLY, DAILY, WEEKLY,<br/> MONTHLY, ONCE, ONSTART, ONLOGON, ONIDLE, ONEVENT.<br/><br/> /MO modifier Refines the schedule type to allow finer control over<br/> schedule recurrence. Valid values are listed in the<br/> "<a href="https://interviewquestions.tuteehub.com/tag/modifiers-753073" style="font-weight:bold;" target="_blank" title="Click to know more about MODIFIERS">MODIFIERS</a>" section below.<br/><br/> /D days Specifies the day of the week to run the task. Valid<br/> values: MON, TUE, WED, THU, FRI, SAT, SUN and for<br/> MONTHLY schedules 1 - 31 (days of the month).<br/> Wildcard "*" specifies all days.<br/><br/> /M months Specifies month(s) of the year. Defaults to the first<br/> day of the month. Valid values: JAN, FEB, MAR, APR,<br/> MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC. Wildcard "*"<br/> specifies all months.<br/><br/> /I idletime Specifies the amount of idle time to wait before<br/> running a scheduled ONIDLE task.<br/> Valid range: 1 - 999 minutes.<br/><br/> /TN taskname Specifies a name which uniquely<br/> identifies this scheduled task.<br/><br/> /TR taskrun Specifies the path and file name of the program to be<br/> run at the scheduled time.<br/> Example: C:\windows\system32\calc.exe<br/><br/> /ST starttime Specifies the start time to run the task. The time<br/> format is HH:mm (24 hour time) for example, 14:30 for<br/> 2:30 PM. Defaults to current time if /ST is not<br/> specified. This option is required with /SC ONCE.<br/><br/> /RI interval Specifies the repetition interval in minutes. This is<br/> not applicable for schedule types: MINUTE, HOURLY,<br/> ONSTART, ONLOGON, ONIDLE, ONEVENT.<br/> Valid range: 1 - 599940 minutes.<br/> If either /ET or /DU is specified, then it defaults to<br/> 10 minutes.<br/><br/> /ET endtime Specifies the end time to run the task. The time format<br/> is HH:mm (24 hour time) for example, 14:50 for 2:50 PM.<br/> This is not applicable for schedule types: ONSTART,<br/> ONLOGON, ONIDLE, ONEVENT.<br/><br/> /DU duration Specifies the duration to run the task. The time<br/> format is HH:mm. This is not applicable with /ET and<br/> for schedule types: ONSTART, ONLOGON, ONIDLE, ONEVENT.<br/> For /V1 tasks, if /RI is specified, duration defaults<br/> to 1 hour.<br/><br/> /K Terminates the task at the endtime or duration time.<br/> This is not applicable for schedule types: ONSTART,<br/> ONLOGON, ONIDLE, ONEVENT. Either /ET or /DU must be<br/> specified.<br/><br/> /SD startdate Specifies the first date on which the task runs. The<br/> format is dd/mm/yyyy. Defaults to the current<br/> date. This is not applicable for schedule types: ONCE,<br/> ONSTART, ONLOGON, ONIDLE, ONEVENT.<br/><br/> /ED enddate Specifies the last date when the task should run. The<br/> format is dd/mm/yyyy. This is not applicable for<br/> schedule types: ONCE, ONSTART, ONLOGON, ONIDLE, ONEVENT.<br/><br/> /EC ChannelName Specifies the event channel for OnEvent triggers.<br/><br/> /IT Enables the task to run interactively only if the /RU<br/> user is currently logged on at the time the job runs.<br/> This task runs only if the user is logged in.<br/><br/> /NP No password is stored. The task runs non-interactively<br/> as the given user. Only local resources are available.<br/><br/> /Z <a href="https://interviewquestions.tuteehub.com/tag/marks-238132" style="font-weight:bold;" target="_blank" title="Click to know more about MARKS">MARKS</a> the task for deletion after its final run.<br/><br/> /XML xmlfile Creates a task from the task XML specified in a file.<br/> Can be combined with /RU and /RP switches, or with /RP<br/> alone, when task XML already contains the principal.<br/><br/> /V1 Creates a task visible to pre-Vista platforms.<br/> Not compatible with /XML.<br/><br/> /F Forcefully creates the task and suppresses warnings if<br/> the specified task already exists.<br/><br/> /RL level Sets the Run Level for the job. Valid values are<br/> LIMITED and HIGHEST. The default is LIMITED.<br/><br/> /DELAY delaytime Specifies the wait time to delay the running of the<br/> task after the trigger is fired. The time format is<br/> mmmm:ss. This option is only valid for schedule types<br/> ONSTART, ONLOGON, ONEVENT.<br/><br/> /? Displays this help message.<br/><br/><br/>marvin/greg/bill,<br/><br/>just tell the OP to type SCHTASKS /? on the command line. There's no need to reproduce the <a href="https://interviewquestions.tuteehub.com/tag/whole-1455252" style="font-weight:bold;" target="_blank" title="Click to know more about WHOLE">WHOLE</a> output of SCHTASKS /? here. Its a waste of space, and doesn't solve anything.[quote="OP"I am trying to write a vbscript[/quote]<br/><br/>What part of "vbscript" don't you understand, BillRich?<br/></p></body></html> | |