Windows Service + Powercfg.exe


  1.    08 Jun 2008 #1
    Daniel Guest

    Windows Service + Powercfg.exe


    Hi,

    I have created a VS Windows Services project to call powercfg.exe
    every 2mins (in a timerdelegate). In On Start event of the service I
    have set the process file name to powercfg.exe and have set argument
    as "/create "my power scheme" and started the process. In the delegate
    fucntion first the get the avaliable scheme and check for my existing
    scheme ("my power scheme"), if its there I set other power settings
    like monitor timeout, disk timeout etc,. Here the catch is when the
    service is started for the first time the On Start event does not
    create a power scheme. I tried creating a power scheme in a windows
    application and it created, but not in a windows service. Is there
    anything that I am missing?

    Thanks.
      My System SpecsSystem Spec

  2.    09 Jun 2008 #2
    Leon Mayne Guest

    Re: Windows Service + Powercfg.exe


    "Daniel" <DFelix19@xxxxxx> wrote in message
    news:00c42a99-4834-494e-a6c2-ea2b722ef1ab@xxxxxx

    > I have created a VS Windows Services project to call powercfg.exe
    > every 2mins (in a timerdelegate). In On Start event of the service I
    > have set the process file name to powercfg.exe and have set argument
    > as "/create "my power scheme" and started the process. In the delegate
    > fucntion first the get the avaliable scheme and check for my existing
    > scheme ("my power scheme"), if its there I set other power settings
    > like monitor timeout, disk timeout etc,. Here the catch is when the
    > service is started for the first time the On Start event does not
    > create a power scheme. I tried creating a power scheme in a windows
    > application and it created, but not in a windows service. Is there
    > anything that I am missing?
    I know this doesn't relate directly to your question, but it may help. It
    sounds like you are just creating a scheduled task rather than a service. I
    personally would consider changing the app to be a console application and
    call it using the scheduled task manager. For more info:
    http://weblogs.asp.net/jgalloway/arc...24/428303.aspx

      My System SpecsSystem Spec

Windows Service + Powercfg.exe

Similar Threads
Thread Forum
Vista 64 Ultimate Powercfg.exe application error
in 2007 CRY4DAWN made this thread. "When I attempted to restart or shutdown Vista, I always get an error box that pops up that says POWERCFG.EXE...
General Discussion
What exactly does 'powercfg -h on|off' do?
My understanding is that it's supposed to enable/disable hibernation. But it doesn't seem to do anything to the settings of any power scheme. I would...
General Discussion
Problem with hibernate mode (powercfg -h on) --> Restarts thecomputer on activation
Hello Everybody, I need your help with my quiet new pc. I switched on the option "powercfg -h on" to get the hibernate mode, but everytime I...
Vista General
V64 Ultimate Powercfg.exe Shut Down Problem...
When I attempted to restart or shutdown Vista, I always get an error box that pops up that says POWERCFG.EXE and has an error code of 0xc0000142. The...
General Discussion
V64 Ultimate Powercfg.exe Shut Down Problem
When I attempted to restart or shutdown Vista, I always get an error box that pops up that says POWERCFG.EXE and has an error code of 0xc0000142. The...
Vista General
Partition shrink: defrag + powercfg off = not working
Hello, I have a toshiba laptop with vista. I did a first shrink on C: with good results. But now, like others, I cant go further down. I...
Vista hardware & devices
Powercfg options
Is there a command line switch to determine if hibernation is oj or off? iIf I type in powercfg -h off, I get message that hibernation state...
Vista General

Our Sites
  • Ten Forums
  • Eight Forums
  • Seven Forums
  • Help Me Bake
  • Site Links
  • Contact Us
  • Privacy and Cookies
  • About Us
    Windows Vista Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

    Designer Media Ltd
    All times are GMT -5. The time now is 12:05.
    .