How to run a program in Windows with only the first core.

Mods and development for mods.

Moderator: Moderators

Steven Aus
Demon
Demon
Posts: 324
Joined: 08 Feb 2006
Location: Australia

How to run a program in Windows with only the first core.

Postby Steven Aus » Nov 6 2017, 8:49

Right click in the Explorer window for the directory you want to create the .cmd file in.
Click New -> Text Document.
Rename the file replacing the extension with .cmd, for example I called mine "H4GreatestModStart.cmd".
Right click on the new .cmd file and click Edit. This will open it in Notepad.

Put these two lines in:

Code: Select all

@echo off
start "<NAME OF CMD WINDOW, CAN BE ANY VALID NAME>" /D "<PATH HERE, NOT INCLUDING FILENAME>" /affinity 1 "<PROGRAM NAME HERE INCLUDING EXTENSION>"


So for example, for Greatest Mod:

https://www.celestialheavens.com/forum/7/16518

Needs HOMM4 Complete or Winds of War.

I have a "H4GreatestModStart.cmd" file that has these two lines:

Code: Select all

@echo off
start "GreatestMod17" /D "<PATH TO DIRECTORY - NOTE INVERTED COMMAS ARE ONLY NECESSARY IF YOU ARE USING SPACES/LONG FILENAMES>" /affinity 1 "Equivocado 17 NoVore.exe"


This will run the program with only CPU 0 enabled. If you want to use any other commands, put it just before /affinity.

Here is the help file for .cmd files (which is basically a Windows batch file):

https://ss64.com/nt/
Last edited by Steven Aus on Nov 6 2017, 9:00, edited 4 times in total.

Return to “Modcrafting Guild”

Who is online

Users browsing this forum: No registered users and 1 guest