Windows 10: How can I use .bat files to run games with different power plans?

Discus and support How can I use .bat files to run games with different power plans? in Windows 10 Software and Apps to solve the problem; Hello, I have created two .cmd files where I can change power plans really quick. The code in the .cmd files looks like this: powercfg /s... Discussion in 'Windows 10 Software and Apps' started by LiFE7, Apr 6, 2017.

  1. LiFE7 Win User

    How can I use .bat files to run games with different power plans?


    Hello,

    I have created two .cmd files where I can change power plans really quick.
    The code in the .cmd files looks like this:

    powercfg /s 381b4222-f694-41f0-9685-ff5bb260df2e
    exit

    This works fine. But now I want to have a .bat file, which activates a power plan until the game is closed.

    For example:

    I want to change the power plan to high performance. Then a game out of origin or steam should start. When I close the game, power plan should switch back to balanced.

    I tried following code, but this still does not work:

    start /b "c:\users"username"\desktop" performance.cmd
    start /d "d:\games\origin" originclientservice.exe
    start /d "d:\games\origin" originwebservice.exe
    start /d "d:games\origin\origin games\mass effect andromeda" masseffectandromeda.exe
    start /b "c:\users"username"\desktop" balanced.cmd

    The game starts, but the balanced power plan is still active. How can I say, that the .bat file has to wait until the game is closed?

    :)
     
    LiFE7, Apr 6, 2017
    #1

  2. Wakeup from Hibernation

    1. if I use it in a ,Bat file how can I paste the results?

    2. I checked my administrative power & could not get the power to "special permissions" ?
     
    walkerpbus, Apr 6, 2017
    #2
  3. JosephLeo Win User
    Password Protect a Folder in Windows 10

    Yes i Agree, files can be kept in safe locker by generating the bat file .

    -> What exactly do you agree with? What is this "Safe Locker"?

    ----------> I meant the folder which we secure.

    To secure it ,Run the bat file,

    -> What is the contents of this batch file?

    ---------->Contents ...I took the contents of the bat file from google.

    Or Hiding the bat file is the only way ...

    -> Hiding a batch file is ineffective. It won't stop an experienced user.

    ---------->My question is , If we are securing the folder say 'A', it can be done by running the bat file...

    But if the bat file is accessible to a 3rd party who access my machine ,,

    If we change the folder name [ A to B ]in bat file, it no longer secures the folder A, it will unlock the folder A.

    So ,is there anyway, can we restrict the access to bat file .. If so how it can be done ?
     
    JosephLeo, Apr 6, 2017
    #3
  4. Berton Win User

    How can I use .bat files to run games with different power plans?

    Usually putting Pause on the line after a command keeps the .bat file open but the usher has to hit Enter for the file to complete. Don't have a solution for the game program to control that.
     
    Berton, Apr 6, 2017
    #4
  5. LiFE7 Win User
    I changed code to this and this works but is not optimal:

    start /b "c:\users"username"\desktop" performance.cmd
    start /d "d:\games\origin\origin games\mass effect andromeda" masseffectandromeda.exe
    start /wait "" "c:\users"username"\desktop" balanced.cmd

    But now desktop directory opens and I have to activate balanced.cmd manually after closing the game.
     
    LiFE7, Apr 6, 2017
    #5
  6. lx07 Win User
    Do you find it makes a difference? Certainly for me games don't run any better using high performance compared to balanced.

    You can't really do this easily (except for clicking on something manually) as the OS doesn't have a trigger for ending a process AFAIK.

    You could write a program to see if d:\games\origin\origin games\mass effect andromeda was running or not and switch power plan.

    Something like this - powershell - How to Correctly Check if a Process is running and Stop it - Stack Overflow but add a pause every 5 seconds or something.

    There would be a minor (probably negligible) impact and may not actually be worth it. You could do it though.

    Technically of course you could put a rocking horse on a Porsche but unless you have a reason to do so it may be pointless.

    I don't find Power Plans make any difference personally as Balanced will take whatever resources it needs anyway.
     
    lx07, Apr 6, 2017
    #6
  7. dalchina New Member
    If you really need to do sthg like that you can use e.g. Autohotkey.

    Once the game has been launched, the script (which is still running) runs a loop to test for the presence of the game process, until not present, then restores your original power plan.
     
    dalchina, Apr 7, 2017
    #7
  8. How can I use .bat files to run games with different power plans?

    You can try Process Lasso, among other things, it changes power profiles.
     
    TairikuOkami, Apr 5, 2018
    #8
Thema:

How can I use .bat files to run games with different power plans?

Loading...
  1. How can I use .bat files to run games with different power plans? - Similar Threads - bat files run

  2. How do I get access to different power performance options on power plan?

    in Windows 10 Gaming
    How do I get access to different power performance options on power plan?: I want to switch power between performances in power plan on windows 11. But there is no other option apart from balanced, what do I do? https://answers.microsoft.com/en-us/windows/forum/all/how-do-i-get-access-to-different-power-performance/2cb32cd0-bfcf-446d-b4fe-17abaf0d0ece
  3. How do I get access to different power performance options on power plan?

    in Windows 10 Software and Apps
    How do I get access to different power performance options on power plan?: I want to switch power between performances in power plan on windows 11. But there is no other option apart from balanced, what do I do? https://answers.microsoft.com/en-us/windows/forum/all/how-do-i-get-access-to-different-power-performance/2cb32cd0-bfcf-446d-b4fe-17abaf0d0ece
  4. Is it safe to run this bat file?

    in AntiVirus, Firewalls and System Security
    Is it safe to run this bat file?: Spo I was wondering how to get sandbox on windows 10 home and I came across this forum saying that I could run this bat file to try and install it.Enable Windows Sandbox Feature in Windows 10 Home Edition Tutorials tenforums.comThe bat file I downloaded was not blocked by...
  5. Can't run .bat files

    in Windows 10 Support
    Can't run .bat files: I haven't run a .bat file in quite a while, so perhaps I unknowingly did something along the was that prompted this problem. I was trying to run Brinks "Reset_Notification_Area_Icons_Cache.bat", but instead the file opens in my text editor. I disassociated .bat in that text...
  6. How to run a .bat file as administrator in startup?

    in Windows 10 Support
    How to run a .bat file as administrator in startup?: Hello. As BitDefender as an ongoing error, I want to run a small "bdfix.bat" at login time. But this .bat file MUST be run as an administrator to work. How do I do that? *Redface 120997
  7. Bat Files Won't Run?

    in Windows 10 Gaming
    Bat Files Won't Run?: Basically I'm installing BattlEye for a Steam game and I click the .bat file in the game's subfolder to download it (when I was prompted to download it I clicked no but now I practically need it for most servers), and I download the .bat from the main website and it also...
  8. Different power plan for different users

    in Windows 10 Support
    Different power plan for different users: As the title suggests, is it possible? My brother favors to choose Shut down when I close the Lid, whereas I prefer Sleep mode.If I change, it changes for my brother's account also.I do not want this.I suspect there might be something useful in Group policy>user...
  9. Trouble running .bat files

    in Windows 10 Support
    Trouble running .bat files: Hi, I'm trying to run .bat files on Windows 10, but it tells me that "This app can't run on your PC". It doesn't matter what I use it for, .bat files just won't run anyway. Are .bat files no longer supported? (ran fine on Windows 7) Any workarounds? I'm no expert on...
  10. Can't Run .Bat Files

    in Windows 10 Support
    Can't Run .Bat Files: I try to run .bat files and the just run in note pad. There is no "open with" option. 48199