RSS

Aylık arşivler: Haziran 2017

CPU Affinity

I developed a simple Windows Service to set a process affinity throughout the system. For example in a Terminal Services environment you donot want Excel process to use all cores (as it may lead to high CPU spikes) and want to limit it to 3 cores (which is enough) then place excel string in processfile.txt file and start the service. During startup and every 10 seconds it looks all excel processes and sets their affinity to 3 cores.

To install service go under the directory where you place all files. Then run InstallUtil.exe cpuaffinity.exe. Donot forget to place processfile.txt in the same directory as I did not handled such errors in the executable.

To download click here !

Due to request I did some changes in the code. Final one is in this location

DOWNLOAD

CHANGES : Config filename is : procandaff.txt. First line is process name and the second line is the number of logical processors you want to set for the process. Currently I only support 1 to 8 logical processors in the code. If you set outside this range or higher number than the logical processors the machine currently has then service exists with config error in app eventlog.

Again no error handling 🙂 so donot forget to place config file where executable resides.

 

 

Remote Run

With this utility I developed you can run remote commands on computers. In the root of executable there must be 2 files: computers.txt (list of computers to run command remotely) and commandline.txt (the command you want to run). For example you need to remove SCCM agent from some of the machines in your domain, then insert C:\Windows\ccmsetup\ccmsetup.exe /uninstall line into commandline.txt and run the executable. I did not spend time to handle errors so donot forget to place these two files before running the tool.

To download the tool click here