General discussion

Locked

Setting Processor Affinity in Win NT 4.0

By jpeterson ·
I know how to set processor affinity manually from Task Manager. Does anyone know if I can automate the process whenever I reboot the machine?

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Setting Processor Affinity in Win NT 4.0

by jpeterson In reply to Setting Processor Affinit ...

Point value changed by question poster.

Collapse -

Setting Processor Affinity in Win NT 4.0

by rightondudeNOSPAM! In reply to Setting Processor Affinit ...

You can permanently set processor affinity for a non-operating system executable, on both Windows 2000 and Windows NT 4.0, by using the Imagecfg.exe tool from the \support\debug\i386 folder of a Windows NT 4.0 CD-ROM

NOTE: Do NOT use imagecfg on any kernel operating system files.

To permanently set the processor affinity for your 32-bit executable, open a CMD prompt and type:

imagecfg -a 0xn <Drive:>\Path\yourprogram.exe

where 0xn is the affinity mask. The mask constrains your application to a specific CPU, from 0 - 31, where:

CPU MASK
0 0x1
1 0x2
2 0x4
3 0x8
4 0x10
5 0x20
6 0x40
7 0x80
8 0x100
etc
To set the affinity for "c:\util\Country Codes.exe" to processor 1, I typed:
imagecfg -a 0x2 "c:\util\Country Codes.exe"

and received the following response:

c:\util\Country Codes.exe contains no configuration information
c:\util\Country Codes.exe contains a Subsystem Version of 4.0
c:\util\Country Codes.exe updated with the following configuration information:
Process Affinity Mask: 00000002

When I launch Country Codes.exe, its' affinity is set to CPU 1.

Collapse -

Setting Processor Affinity in Win NT 4.0

by Shanghai Sam In reply to Setting Processor Affinit ...

Thanks very much for your answer. I was beginning to think there was no way of acheiving my goal. I use this machine to run Visual FoxPro, which, left to it's own devices, will hog as much of the processors' time as it can. By setting the affinity for VFP to the second processor, I can continue to use the machine for other work while VFP is toiling away.

Collapse -

Setting Processor Affinity in Win NT 4.0

by jpeterson In reply to Setting Processor Affinit ...

This question was closed by the author

Back to Windows Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums