View Single Post
Old 11-13-15, 11:09 AM   #328
Choum
Sparky
 
Join Date: Aug 2012
Posts: 157
Downloads: 344
Uploads: 3
Default

For people who don't want to manually change the process priority each time here a script that will launch the game and change the process priority.

In BATCH
Quote:
@echo off
"I:\Games\Silent Hunter 5\sh5.exe"
:LOOP
echo "WAITING FOR OSI TO LAUNCH"
Tasklist | find /i "OSI" >nul 2>&1
IF ERRORLEVEL 1 (
timeout /t 2
GOTO LOOP
) ElSE (
ECHO "OSI FOUND"
WMIC PROCESS WHERE NAME="osi.exe" CALL setpriority "High priority"
ECHO "OSI PRIORITY CHANGE TO HIGH"
)
exit



In POWERSHELL
Quote:
"I:\Games\Silent Hunter 5\sh5.exe"
wait-process -Name osi
$Osi = (Get-process osi).id
$Osi.PriorityClass = 'High'
You just have to change the path to the sh5.exe and put one of the script as a shortcut create a .bat for the batch and ps1 file for the powershell.

The more simple to use is the batch one, the powershell script need some security tweak to run as it will be unsigned.

Last edited by Choum; 11-13-15 at 11:57 AM.
Choum is offline   Reply With Quote