locked
Powercfg not running from Task Scheduler RRS feed

  • Question

  • I wish to set up a XP laptop with family pictures as a screen saver, and have the monitor turn off during the night (8pm-8am).

    I set up the following powercfg with a day and night profile setting monitortimeout AC 2  and none.  I can run these from the command line with no problem, either manually or in a batch file.   (ie:  powercfg /setactive day )

    When I try run it through the scheduler (after setting permissions),  it shows it runs with 0x0 result, but does not change the power settings.

    I have even tried to create executables with QB45 and they run from the command line, but not through the scheduler.

    Sunday, October 12, 2014 2:47 PM

All replies

  • Run this task as SYSTEM. Redirect the output to text file and analyze it.

    Follow parametrs here

    http://technet.microsoft.com/en-us/library/cc748940(v=ws.10).aspx

    Alternative to cmd/bat file may be Visual Basic Script (vbs file) with output redirected to text file.

    Rgds

    Milos


    • Edited by Milos Puchta Sunday, October 12, 2014 8:13 PM REF
    Sunday, October 12, 2014 8:09 PM
  • Thank you for the reply Milos,

    I can't get this to run.

    The scheduled task is configured as:

    C:\WINDOWS\Tasks\day.job

    Run:  c:\windows\system32\day.bat

    Start in:  c:\windows\system32

    Comments:  ( none)

    Run as:  NT AUTHORITY\SYSTEM   (no password and space between NT and AUTHORITY. This was set as                                                   MARIE-2716N52NL\Marie  originally and it did not run, but then when I                                                   went to set it, it defaulted to this setting).

    Run only if logged on  ( unchecked)

    enabled ( checked)

    On the settings tab, only the Wake the computer to run this task is checked.

    I created the settings using:

    powercfg /create day

    powercfg /change day /monitor-timeout-ac 0   ( for the day profile)

    and 

    powercfg /create night

    powercfg /change night /monitor-timeout-ac 2  ( to turn monitor off after 2 minutes at night)

    I can then run  powercfg /setactive day  ( or night) from a command prompt and these run and configure the PC properly

    When I tried to run the setactive from task scheduler, I get a status  "Could not start"

    When I put that setactive command in a batch file (day.bat) and run it from task scheduler,  I get a result code 0x1  but if I add a 2nd line to the batch file  with    date /T >> c:\stat    I get a result code of 0x0 and the date appends to the c:\stat  file so I know the task ran, but the power setting does not change.

    Hope you can help... this has been really frustrating.  

    Thanks again,  (sorry for the long-winded explanation). 

    Ron

    Wednesday, October 15, 2014 4:46 AM