22 May, 2014

Create Task scheduler task via commandline/powershell.

schtasks.exe /Create /TN hello_world /SC ONEVENT /EC Security /MO *[System/EventID=4624] /TR C:\hello.vbs /RU BUILTIN\Users  /DELAY 0000:10

No way to disable via commandline with schasks.exe:
Task Scheduler GUI, Conditions, Power: Start the task only if the computer is on AC power.

Create Task via GUI, export, import via commandline:
schtasks.exe /Create /TN hello_world /XML C:\hello_world.xml
http://social.technet.microsoft.com/Forums/windows/en-US/8d45efa6-a82f-4fb7-8064-77a30ec645ba/is-it-possible-to-disable-the-run-on-ac-power-using-schtasksexe-cmdline-switches?forum=w7itprogeneral

5 comments:

  1. How to disable AC Power or DC power through batch script?
    Actually I'm creating task using batch file. plz give some suggestion how to disable the power option

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete

  3. easy. create the task with the wizard, then configures everything disables AC power and then export it to XML , then edit the XML and remove the line Author and ready can use and import on any computer with the AC Off and other settings intact

    ReplyDelete

  4. easy. create the task with the wizard, then configures everything disables AC power and then export it to XML , then edit the XML and remove the line Author and ready can use and import on any computer with the AC Off and other settings intact

    ReplyDelete

  5. easy. create the task with the wizard, then configures everything disables AC power and then export it to XML , then edit the XML and remove the line and ready can use and import on any computer with the AC Off and other settings intact

    ReplyDelete