PDA

View Full Version : Script for Starting SAC/SAW at best settings



Carl G.
08-30-2016, 12:43 AM
One of my son (a computer programmer who worked for Continuum.IO) just wrote me a nice little custom script which starts SAC/SAWStudio with custom Windows 10 Power Plan settings optimum for SawStudio or SAC, but then returns the System's Power Plan back to the conservative "Balanced" power plan setting upon SawStudio Exit. So, now I have the benefits of Balanced Power options during all uses except when needed for SawStudio. This may be especially handy for laptop use. I was suprised to see my 3.8ghz machine could comfortably perform at under 1ghz in many normal everyday uses (which saves a lot of engergy... battery... etc). The convenience of SawStudio as normal (with shortcut), and exiting as normal, while automatically adjusting the System PowerPlan just during use of Saw/SAC, is pretty nice. (oh... we also change the System wide multi-threading down to 2 core during Saw/SAC usage, or 1 core if desired)

If anyone is interested, he'd be happy to pass the script along for your customization needs.

mr_es335
08-30-2016, 08:04 AM
Carl,

Interested, and curious...

Carl G.
08-30-2016, 08:26 AM
Carl,

Interested, and curious...

The re-worded posts clarifies that I also use this for a cooler running, lower power drawing system during non-SawStudio hours, while maintaining System peak performance while using SawStudio. With the Shortcut Key redirected to the script... SAW/SAC starts and exits seamlessly as usual... but the PowerPlan (and System Multi-Threading) is customized for Peak High Performance just during SawStudio use. I can see this as also very handy for Laptop use.

I'll PM you.

Kurt Kroh
08-30-2016, 07:01 PM
I would love to try it out.

Thank you!

averombri
08-31-2016, 11:39 AM
i would like to try it,win 10 is a challenge for me
thanks

Carl G.
09-16-2016, 07:39 PM
Power Management Wrapper for SAC

Description
A simple Powershell wrapper that will launch SAC. The standout feature of the script is to conveniently change the Windows Power Plan to a more performance oriented plan only while SAC is running. This allows you to set your laptop or computer to a default power saving plan of your choice in a multi-purpose environment, then automatically switch it into High Performance mode only while SawStudio is running.

The setup is this:

Create a desired High Performance Power Plan optimized for SAC. Call it "SawStudioPower"
Place SACPM.ps1 in the SAC folder (download below)
Right click on the file -> Properties. In the "General" tab, check "Unblock"
Create a shortcut to SACPM.ps1 (for starting SAC)
Enter "Target": C:\Windows\System32\WindowsPowerShell\v1.0\powersh ell.exe -File "SACPM.ps1"
Enter "Start In": "C:\Program Files\SAC" (or whatever directory SAC is in)
(you can also change the icon to the SAC icon if you wish)
Open up PowerShell and type: Get-ExecutionPolicy (and press enter)
If the results says "Restricted" or "AllSigned", you'll need to follow the note below before running SAC.ps1.
Launch SAC via the newly created shortcut from above (I pinned my shortcut to the taskbar).


Note

Windows, by default, disables the execution of Powershell scripts. To allow SACPM.ps1 to run, you need to open a Powershell window (run as administrator) and type the following:


Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

The above command is system wide, and allows local Powershell scripts to execute, but configuration files or other scripts that are downloaded from the internet have to be signed by a trusted publisher before they will run.
If you decide later to revert to Windows default, you can undo the above change by opening PowerShell (run as admistrator) and type the following:

Set-ExecutionPolicy -ExecutionPolicy Undefined
You can read more about Set-ExecutionPolicy at https://technet.microsoft.com/en-us/library/hh849812.aspx.


Additional Notes:
At the top of the script are several variables which can be set




$target_plan = "SawStudioPower"
$exe_name = "SAC.exe"


Here's what each of the code variables do:

target_plan: The plan to toggle when executable is launched.
The script will save the currently active plan and when the launched process
exits, the power plan will be toggled back.
exe_name: name of the executable (in the current folder) to launch



Download
The script file is available here (right click and Save As): SACPM.ps1 (http://ryangrout.com/ps/SACPM.ps1)
Here's the hash to verify the integrity of the original file: (sha1: 96c800b46049ae47524f6e5f2904ee4810a9f36b)

The script above is released under the BSD license. You may modify and redistribute the script (as long as license is kept intact).

Carl G.
09-16-2016, 08:16 PM
We also posted a Power Management Wrapper for SawStudio on the SawStudio forum.

You can run both Power Management Wrappers (both SawStudio/SAC) at the same time but you will need to exit the programs in the reverse order in which you started them to allow Power Management to return to your default Power Management.