Jump to content

Helpful Scripts for Gaming Laptops

Hi all,

 

This may be helpful to some people so I decided to share some basic scripts I wrote for my MSI GF65 thin. A lot of gaming laptops don't last long on battery. Monitoring programs and high refresh rate screens make this worse. Some laptops automatically change the refresh rate when on battery power, but mine doesn't. I use MSI Afterburner, RivaTuner, and HWINFO on my laptop while gaming. Rivatuner is great for keeping an eye on temperatures and clock speeds, and HWINFO can actually be linked to Rivatuner to show additional information in the on-screen display.

 

First off, two excellent pieces of software I highly recommend.

 

Change Screen Resolution Utility

https://tools.taubenkorb.at/change-screen-resolution/

 

Custom Resolution Utility

https://www.techspot.com/downloads/7345-custom-resolution-utility.html

 

 

Change Screen Resolution is the program being referenced at the bottom of each batch file. Please note that it can only switch to refresh rates that have already been created on the system. This is where Custom Resolution Utility (CRU) comes in. CRU lets you create custom refresh rates that can be used after restarting your laptop.

 

- Feel free to change "144" or "60" in the batch files to whichever values you prefer. Some laptops have 120hz or 240hz panels, so you'll want to insert the maximum refresh rate for your laptop in the game mode batch file, and a lower refresh rate in the normal/battery mode batch file. For some laptops, you may need to change the "DISPLAY1" value to "DISPLAY0" for the script to work. If the script works, the screen should turn black briefly, which indicates that it is changing the refresh rate.

 

- You can also swap out any of the programs in these batch files if you prefer. You simply need to know the file location of the program you want to start for the game mode file, and the name of the program.exe file to kill the program in the normal/battery mode batch file.

 

- Don't forget to replace the "user" after "C:\Users\" in each command with your username.

 

Game Mode Batch File (paste the following into notepad and save with a .bat file extension)

start "" "C:\Program Files (x86)\MSI Afterburner\MSIAfterburner.exe"
start "" "C:\Program Files (x86)\RivaTuner Statistics Server\RTSS.exe"
start "" "C:\Users\user\Downloads\HWiNFO64\HWiNFO64.exe"
C:\Users\user\Downloads\ChangeScreenResolution.exe /f=144 /d=\\.\DISPLAY1

 

 

Normal/Battery Mode Batch File (paste the following into a different notepad window and save with a .bat file extension)

Taskkill /f /im MSIAfterburner.exe
Taskkill /f /im RTSS.exe
Taskkill /f /im HWiNFO64.exe

C:\Users\user\Downloads\ChangeScreenResolution.exe /f=60 /d=\\.\DISPLAY1

 

IMPORTANT

Given that the Normal/Battery Mode batch file is killing running applications, you may need to give the batch file administrative privileges. This can either be done by right clicking the batch file and choosing "Run as Administrator", or by creating a shortcut to the batch file and giving the shortcut administrative privileges. 

 

The script is very basic, and could likely be improved upon by folks smarter than myself. These scripts make switching between gaming and preserving battery life a one click process. It is also possible to add the following commands to the batch files as well.

 

High Performance Mode (optional for Game Mode Batch File)

powercfg.exe /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

 

Power Saver Mode (optional for Normal/Battery Mode Batch File)

powercfg.exe /setactive a1841308-3541-4fab-bc81-f71556f20b4a

 

 

 

Hopefully someone out there finds this useful! 🙂

 


 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×