I suggest you ...

Let us know how to start batterysaver with logon. I cant figure it out.

4 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    DeanDean shared this idea  ·   ·  Admin →

    2 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Kev MaitlandKev Maitland commented  · 

        As an improvement to my previous comment, I think I see some of the issues that Dean was alluding to. I was getting .NET fileNotFound errors when launching the executable from a script, which seemed to be caused my me omitting the "Start In" directory.

        I ended up deploying via GPO this slightly differently using a Scheduled Task to avoid giving the users Local Administrator rights:

        Computer Configuration | Preferences | Windows Settings | Folders | C:\Program Files\Battery Saver\
        Computer Configuration | Preferences | Windows Settings | Files | \\networkshare\BatterySaver.exe > C:\Program Files\Battery Saver\Battery Saver.exe
        Computer Configuration | Preferences | Windows Settings | Files | \\networkshare\config.xml > C:\Program Files\Battery Saver\config.xml
        Computer Configuration | Preferences | Control Panel Settings | Scheduled Tasks

        The XML for the Scehduled Task entry is below, but there isn't a way to import it directly into the GPO via the GUI, but you can save the XML to the relevant Policies\{}\Machine\Preferences\ScheduledTasks folder:

        <?xml version="1.0" encoding="utf-8"?>
        <ScheduledTasks clsid="{CC63F200-7309-4ba0-B154-A71CD118DBCC}"><TaskV2 clsid="{D8896631-B747-47a7-84A6-C155337F3BC8}" name="Start BatterySaver" image="2" changed="2016-10-24 13:23:56" uid="{F0B5C055-2C0C-4951-B57D-3A1D5C8383A9}"><Properties runAs="SYSTEM" logonType="S4U" action="U" name="Start BatterySaver"><Task version="1.3"><RegistrationInfo><Author>ItKevIsSkill</Author><Description>Launches BatterySaver app automatically at Boot</Description></RegistrationInfo><Principals><Principal id="Author"><UserId>SYSTEM</UserId><LogonType>S4U</LogonType><RunLevel>HighestAvailable</RunLevel></Principal></Principals><Settings><IdleSettings><Duration>PT10M</Duration><WaitTimeout>PT1H</WaitTimeout><StopOnIdleEnd>true</StopOnIdleEnd><RestartOnIdle>false</RestartOnIdle></IdleSettings><MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy><DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries><StopIfGoingOnBatteries>true</StopIfGoingOnBatteries><AllowHardTerminate>true</AllowHardTerminate><AllowStartOnDemand>true</AllowStartOnDemand><Enabled>true</Enabled><Hidden>false</Hidden><ExecutionTimeLimit>P3D</ExecutionTimeLimit><Priority>7</Priority></Settings><Triggers><BootTrigger><Enabled>true</Enabled></BootTrigger></Triggers><Actions Context="Author"><Exec><Command>C:\PROGRA~1\BatterySaver\BatterySaver.exe</Command><WorkingDirectory>C:\PROGRA~1\BatterySaver\</WorkingDirectory></Exec>
        </Actions></Task></Properties></TaskV2>
        </ScheduledTasks>

        This task fires on boot, so the tool is running before the user logs in. My config.xml is in another comment and it sets the Power Settings Mode based on whether AC is connected (and no other functionality). This means that the laptops are automatically set to "Power Saver" on battery and "Balanced" on AC without any user intervention, without any additional permissions, and regardless of whether the user has logged in. As it's running under NT AUTHORITY\SYSTEM, it means that the user doesn't have access to the GUI for BatterySaver, but it's up to you as to whether this is a good or bad thing :)

      • Kev MaitlandKev Maitland commented  · 

        You can do this via Group Policy. If you're in a Domain, run gpmc.msc on a Domain Controller. If you're not, run gpedit.msc on your PC.
        To start the app at login, add an entry like this:
        User Configuration | Windows Settings | Scripts (Logon) | Logon | Add | [Path\To\BatterySaver.exe\On\The\PC\BatterySaver.exe]

        To start the app at boot, add an entry like this:
        Computer Configuration | Windows Settings | Scripts (Startup) | Startup | Add | [Path\To\BatterySaver.exe\On\The\PC\BatterySaver.exe]

      Feedback and Knowledge Base