Save process priority and affinity

Cyberuben

New member
Local time
7:07 AM
Messages
20
Hello,

I'm running a few gameservers myself on Windows Server 2008 R2 but I'm wondering if it's possible to make my system recognize that the process was ran earlier, and it'll apply the correct affinity and priority.

The problem is that I used to use ProcessLasso, but after 40 days of uptime (and then a restart) I'm not able to run the program without purchasing it.
 

My Computer

OS
Windows 7 Home Premium x64
CPU
AMD FX-8150 Bulldozer @ 4.2 Ghz
Motherboard
ASUS M5A78L-M/USB3 MicroATX
Memory
4x 4GB
Graphics Card(s)
XFX Radeon HD6870 2GB
Sound Card
-
Monitor(s) Displays
ACER H223HQ / ASUS VS228H
Screen Resolution
1920x1080 x2
Hard Drives
Samsung SpinPoint F3 Desktop Class HD502HJ
Western Digital 2TB
PSU
Corsair Builder Series CX600 V2
Case
Thermaltake Strike MX VI6000BNS
Cooling
Scythe Mugen 3 Rev. B SCMG-3100
Keyboard
Logitech G15 Keyboard
Mouse
Logitech Performance FX
Internet Speed
122 mb/s down, 20 mb/s up
Purchase the program. Of find an alternative. I don't have one.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Alienware Aurora ALX R4
OS
Windows 10 Pro (x64)
CPU
Intel Core i7-3930K (3.2GHz - 4.5GHz)
Motherboard
Alienware Aurora-R4 x79
Memory
4x Samsung 4GB PC3-12800 DDR3 (16GB 1600MHz)
Graphics Card(s)
Nvidia Geforce GTX 690
Sound Card
SteelSeries Siberia Elite
Monitor(s) Displays
Dell UltraSharp U3011
Screen Resolution
2560x1600
Hard Drives
Samsung 850 Pro 256 GB, Seagate 1TB Desktop Hybrid HDD, 2x Western Digital 4TB Green HDD
PSU
875W Some Dell PSU <.<
Case
Alienware Aurora ALX
Cooling
Custom Liquid Cooling (EK CPU & GPU blocks) dual EK 480RAD
Keyboard
Logitech G710+ Mechanical
Mouse
Logitech G700s
Internet Speed
Verizon Fios (50 mbps average)
Other Info
Server: Intel NUC D54250WYK: i5-4250U, 16GB, 256 GB mSATA, Windows Server 2012 R2
Purchase the program. Of find an alternative. I don't have one.

I didn't really create this thread to be told to purchase the program. It's $89 just because I'm using Windows Server 2008, otherwise it'd be $30, which isn't such a deal.
 

My Computer

OS
Windows 7 Home Premium x64
CPU
AMD FX-8150 Bulldozer @ 4.2 Ghz
Motherboard
ASUS M5A78L-M/USB3 MicroATX
Memory
4x 4GB
Graphics Card(s)
XFX Radeon HD6870 2GB
Sound Card
-
Monitor(s) Displays
ACER H223HQ / ASUS VS228H
Screen Resolution
1920x1080 x2
Hard Drives
Samsung SpinPoint F3 Desktop Class HD502HJ
Western Digital 2TB
PSU
Corsair Builder Series CX600 V2
Case
Thermaltake Strike MX VI6000BNS
Cooling
Scythe Mugen 3 Rev. B SCMG-3100
Keyboard
Logitech G15 Keyboard
Mouse
Logitech Performance FX
Internet Speed
122 mb/s down, 20 mb/s up
If the program need purchased to play then that is what is needed. We are not going to tell you how to bypass the any copyright. Please read our rules. #4
Windows 7 Forums - Forum Rules
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Home made Desktop
OS
Windows 10 Pro. 64/ version 1709 Windows 7 Pro/64
CPU
Intel i7-6800K @ 4.3
Motherboard
ASUS X-99 Deluxe II
Memory
Corsair Platinum 16 gig @2400
Graphics Card(s)
EVGA GTX 1070 OC
Monitor(s) Displays
Asus 27" LED LCD/VE278Q
Screen Resolution
1920-1080 or 1280-720 HDMI
Hard Drives
INTEL SSD 730-240 Gb Sata 3.0/
PSU
EVGA Platium 1200W
Case
Phanteks Luxe Tempered Glass 8 fans/ one radiator
Cooling
XSPC/ Water Cooled CPU
Keyboard
Das 4 Professional
Mouse
Logitech M705/MX Anywhere 2-S
Internet Speed
100 mbits
Antivirus
Microsoft Security Essentials/ Malwarebytes Premium 3.0/ SAS
Browser
I.E. 11 default/Firefox/ ISP Time Warner Cable/Spectrum
Other Info
LG BluRay Burner/
Sound system-KLipsch-THX/
Icy Dock ssd Hot Swap bays.

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
Is there a way to do this using batch? So I can just make a "start.bat" that makes it run with the correct affinity and priority? The problem is that I'm trying to run Source servers, which don't really work properly on multiple cores. So I'd like to run my servers each on a single core, unless they are like a 10 slot server.

Currently I work with a set of shortcuts. The shortcuts have the following "command":
Code:
C:\Servers\Public\Minigames\Deathrun\orangebox\srcds.exe -console -game garrysmod -port 27031 +map deathrun_marioworld_final -maxplayers 48 -ip 69.162.117.58
Is it possible to run the same "command" but with parameters that make it have the correct affinity and priority?
 

My Computer

OS
Windows 7 Home Premium x64
CPU
AMD FX-8150 Bulldozer @ 4.2 Ghz
Motherboard
ASUS M5A78L-M/USB3 MicroATX
Memory
4x 4GB
Graphics Card(s)
XFX Radeon HD6870 2GB
Sound Card
-
Monitor(s) Displays
ACER H223HQ / ASUS VS228H
Screen Resolution
1920x1080 x2
Hard Drives
Samsung SpinPoint F3 Desktop Class HD502HJ
Western Digital 2TB
PSU
Corsair Builder Series CX600 V2
Case
Thermaltake Strike MX VI6000BNS
Cooling
Scythe Mugen 3 Rev. B SCMG-3100
Keyboard
Logitech G15 Keyboard
Mouse
Logitech Performance FX
Internet Speed
122 mb/s down, 20 mb/s up
Found a way. Instead of running that command directly, you need to run it though the "start" built-in command, it allows to set both the starting priority and affinity mask:

Code:
START /LOW /AFFINITY 1 C:\Servers\Public\Minigames\Deathrun\orangebox\srcds.exe -console -game garrysmod -port 27031 +map deathrun_marioworld_final -maxplayers 48 -ip 69.162.117.58

This one starts the server with the lowest possibly priority and running on CPU 0 only. Just adjust the first parameters to whatever you need in the command line from your shortcut and you're done.
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba Sattelite A665-S6092
OS
Windows 7 Ultimate x64
CPU
Intel Core i7-740QM
Memory
8 GB DDR3
Graphics Card(s)
NVIDIA GeForce 330GT
Screen Resolution
1366x768
Hard Drives
Samsung 840 SSD 500GB
1TB USB3 external HD
Cooling
Coolermaster Notepal U3 notebook cooling pad
Internet Speed
3mbps ASDL
Antivirus
ClamWin 0.98.7
Browser
Opera 12.17 x86 (main), Firefox 38 (sec), IE11 (last resort)
Found a way. Instead of running that command directly, you need to run it though the "start" built-in command, it allows to set both the starting priority and affinity mask:

Code:
START /LOW /AFFINITY 1 C:\Servers\Public\Minigames\Deathrun\orangebox\srcds.exe -console -game garrysmod -port 27031 +map deathrun_marioworld_final -maxplayers 48 -ip 69.162.117.58

This one starts the server with the lowest possibly priority and running on CPU 0 only. Just adjust the first parameters to whatever you need in the command line from your shortcut and you're done.

Thanks a ton!
 

My Computer

OS
Windows 7 Home Premium x64
CPU
AMD FX-8150 Bulldozer @ 4.2 Ghz
Motherboard
ASUS M5A78L-M/USB3 MicroATX
Memory
4x 4GB
Graphics Card(s)
XFX Radeon HD6870 2GB
Sound Card
-
Monitor(s) Displays
ACER H223HQ / ASUS VS228H
Screen Resolution
1920x1080 x2
Hard Drives
Samsung SpinPoint F3 Desktop Class HD502HJ
Western Digital 2TB
PSU
Corsair Builder Series CX600 V2
Case
Thermaltake Strike MX VI6000BNS
Cooling
Scythe Mugen 3 Rev. B SCMG-3100
Keyboard
Logitech G15 Keyboard
Mouse
Logitech Performance FX
Internet Speed
122 mb/s down, 20 mb/s up
I found out the following:
CPU 0 = 1
CPU 1 = 2
CPU 3 = 4
CPU 4 = 8
CPU 5 = 16
CPU 6 = 32
CPU 7 = 64
CPU 8 = 128.

But when I use the start command with 128, it'll run core 3 and 5, which is 20. Strange.
 

My Computer

OS
Windows 7 Home Premium x64
CPU
AMD FX-8150 Bulldozer @ 4.2 Ghz
Motherboard
ASUS M5A78L-M/USB3 MicroATX
Memory
4x 4GB
Graphics Card(s)
XFX Radeon HD6870 2GB
Sound Card
-
Monitor(s) Displays
ACER H223HQ / ASUS VS228H
Screen Resolution
1920x1080 x2
Hard Drives
Samsung SpinPoint F3 Desktop Class HD502HJ
Western Digital 2TB
PSU
Corsair Builder Series CX600 V2
Case
Thermaltake Strike MX VI6000BNS
Cooling
Scythe Mugen 3 Rev. B SCMG-3100
Keyboard
Logitech G15 Keyboard
Mouse
Logitech Performance FX
Internet Speed
122 mb/s down, 20 mb/s up
Apparently, the affinity mask seems to be an hex number, not decimal as we though. And 128 in hex equals 100101000 in binary, which enables CPU 3, 5 and 8. So, the actual table should be:

CPU 0=1
CPU 1=2
CPU 2=4
CPU 3=8
CPU 4=10
CPU 5=20
CPU 6=40
CPU 7=80

And add those values in any combination to enable more than one CPU. But add them in hexadecimal (Windows built-in calculator in programmer mode can do the math).
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba Sattelite A665-S6092
OS
Windows 7 Ultimate x64
CPU
Intel Core i7-740QM
Memory
8 GB DDR3
Graphics Card(s)
NVIDIA GeForce 330GT
Screen Resolution
1366x768
Hard Drives
Samsung 840 SSD 500GB
1TB USB3 external HD
Cooling
Coolermaster Notepal U3 notebook cooling pad
Internet Speed
3mbps ASDL
Antivirus
ClamWin 0.98.7
Browser
Opera 12.17 x86 (main), Firefox 38 (sec), IE11 (last resort)
Back
Top