help me create an script to run games on high performance

Page 1 of 2 12 LastLast

  1. Posts : 45
    Windows 10 20H2
       #1

    help me create an script to run games on high performance


    Everytime I run an open world game with balanced power plan, it's sucks. Sure, the easy way it's just to use high performance power plan for everything. The thing is, this waste more energy in the long run. Every time I try to use high performance when I'm playing, I forgot to switch back to balanced when I close the game.

    The whole reason why I want to create a script to do this it's because I try many thing to make open world games run on balanced mode with no frametime issues, caused by cpu clock slowing down once in a while. I use v-sync, my monitor it's 60hz. Balanced power plan only works properly if I let the game fps free (fast sync or v-sync off).

    So, about the script, I basically want to run the game through the script making Windows switch to high performance power plan and than switch back to balanced when I close the game.
      My Computer


  2. Posts : 4,187
    Windows 11 Pro, 22H2
       #2

    Open a command prompt and run this command:

    powercfg /list

    On my computer I get the following output:

    Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced) *
    Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance)
    Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a (Power saver)

    The asterisk indicates that "Balanced" is the active configuration.

    Now, create a batch file with the following lines:

    Code:
    powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
    <command to run your game>
    powercfg /setactive 381b4222-f694-41f0-9685-ff5bb260df2e
    NOTE: In the first line specify the string associated with the "High performance" mode from the "powercfg /list" command. It may be different than mine. On the 3rd line, use that which is associated with "Balanced".

    For the command to run your game, you may have to specify the full path. You may want to simply right-click a shortcut that you have for the game and select properties. On the "shortcut" tab, note the command in the "Target" field. Use that.

    In theory, I think that should work. Try it and let me know!
      My Computers


  3. Posts : 45
    Windows 10 20H2
    Thread Starter
       #3

    Didn't worked. I tried
    powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
    "C:\GAMES\Red Dead Redemption 2\RDR2.exe"
    powercfg /setactive 381b4222-f694-41f0-9685-ff5bb260df2e

    the game start, but balanced mode is set on power managment

    I tried
    powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
    "C:\GAMES\Red Dead Redemption 2\RDR2.exe"

    than power managment was set to high performance, which means the code is setting high performance, run the game and then switches to balanced again on the first code attempt.
      My Computer


  4. Posts : 4,187
    Windows 11 Pro, 22H2
       #4

    Note sure I followed the last part of what you said.

    So, when you run

    powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
    "C:\GAMES\Red Dead Redemption 2\RDR2.exe"

    that works, right?

    It's just that if you run the batch file that contain the second powercfg command that you have a problem, right?
      My Computers


  5. Posts : 45
    Windows 10 20H2
    Thread Starter
       #5

    hsehestedt said:
    Note sure I followed the last part of what you said.

    So, when you run

    powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
    "C:\GAMES\Red Dead Redemption 2\RDR2.exe"

    that works, right?

    It's just that if you run the batch file that contain the second powercfg command that you have a problem, right?
    Yes.

    When I run the full command, my power managment is set do balanced, because the command tells Windows to set high performance, run the game and then switch back to balanced mode (with the game running)

    - - - Updated - - -

    I think we need to add some command line to prevent windows to switch back to balanced mode when the game is running.
      My Computer


  6. Posts : 4,187
    Windows 11 Pro, 22H2
       #6

    I'm going to be away for a while, so let me suggest a simple workaround for now if my assumption was right....

    Add 1 more line like this:

    Code:
    powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
    "C:\GAMES\Red Dead Redemption 2\RDR2.exe"
    pause
    powercfg /setactive 381b4222-f694-41f0-9685-ff5bb260df2e
    The pause will stop the last line from running until you hit a key within the command prompt. So after the game ends, just switch to command prompt and press ENTER.

    Let me know if that helps. Will see if I can determine anything better later.
      My Computers


  7. Posts : 5,330
    Windows 11 Pro 64-bit
       #7

    With this batch script you can enable Ultimate Performance power plan in Windows 10.
    help me create an script to run games on high performance Attached Files
      My Computer


  8. Posts : 45
    Windows 10 20H2
    Thread Starter
       #8

    hsehestedt said:

    Let me know if that helps. Will see if I can determine anything better later.
    It's helps a lot. If you can find anything better, please let me know. I wanna see if I can just open the game switch to high performance, play it, close game game and then switch back to balanced.
      My Computer


  9. Posts : 582
    Windows 10 Home
       #9

    powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
    start /wait "C:\GAMES\Red Dead Redemption 2\RDR2.exe"
    powercfg /setactive 381b4222-f694-41f0-9685-ff5bb260df2e
      My Computer


  10. Posts : 45
    Windows 10 20H2
    Thread Starter
       #10

    Ben Myers said:
    powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
    start /wait "C:\GAMES\Red Dead Redemption 2\RDR2.exe"
    powercfg /setactive 381b4222-f694-41f0-9685-ff5bb260df2e
    didn't worked. Just opened a prompt with the game .exe

    - - - Updated - - -

    also switched to high performance, but didn't switched back to balanced when I closed.
    Attached Thumbnails Attached Thumbnails help me create an script to run games on high performance-screenshot_2.png  
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 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 11:38.
Find Us




Windows 10 Forums