none
Task Scheduler Options RRS feed

  • Question

  • Hey guys,

    I have a simple script to create multiple scheduled tasks, but am curious if there is a way to add in the option to select the "Run with highest privileges" and also the "Start In" path under the Actions tab.

    This is what we are using to create the scripts, but it would be nice to not have to go back in and select/input those options.

    schtasks /create /ru %domain%\administrator /RP ******** /SC DAILY /TN Midday-SFTP /TR D:\NS5\6.2.1-GA\Standard\scripts\Midday-SFTP.cmd /ST 19:00

    Thursday, April 23, 2015 5:05 PM

Answers

  • Hi Mjannise,

    one piece of advice: The first target I'd ask when trying to figure out how a command works, is the command itself:

    schtasks /create /?

    Reading this text (quite a bit, I admit) will direkt you to the /RL Parameter and its usage.

    I don't see how you can change the Start-In path using schtasks, however you could ...

    a) Write the path into the script
    b) Pass the path to the script as parameter
    c) Write the task as an xml file and pass the XML definition to schtasks (You can export a task as XML from the task-scheduler)

    Cheers,
    Fred


    There's no place like 127.0.0.1

    • Marked as answer by mjannise Friday, April 24, 2015 12:18 PM
    Friday, April 24, 2015 7:24 AM

All replies

  • This is not a scripting question. It is a question about how to use a utility program.  I recommend posting in the forum for you OS.

    You could also use your search engine to find examples of how to use the utility.


    \_(ツ)_/

    Thursday, April 23, 2015 5:13 PM
  • Hi Mjannise,

    one piece of advice: The first target I'd ask when trying to figure out how a command works, is the command itself:

    schtasks /create /?

    Reading this text (quite a bit, I admit) will direkt you to the /RL Parameter and its usage.

    I don't see how you can change the Start-In path using schtasks, however you could ...

    a) Write the path into the script
    b) Pass the path to the script as parameter
    c) Write the task as an xml file and pass the XML definition to schtasks (You can export a task as XML from the task-scheduler)

    Cheers,
    Fred


    There's no place like 127.0.0.1

    • Marked as answer by mjannise Friday, April 24, 2015 12:18 PM
    Friday, April 24, 2015 7:24 AM
  • Thank you, Fred!

    Friday, April 24, 2015 12:19 PM