Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Trying to edit a batch file to run with a higher CPU priority

01 Feb 2014   #1
Rehan

Windows 7 Pro x64
 
 
Trying to edit a batch file to run with a higher CPU priority

Hi guys,

Long time reader, first time poster.

I have a batch file, named lima.bat which has the following code in it:

Code:
del *.bin
setx GPU_MAX_ALLOC_PERCENT 100
setx GPU_USE_SYNC_OBJECTS 1
color 02
C:\Users\user\Desktop\MineIt\cgminer.exe  --config C:\Users\user\Dropbox\Lima\gigabyte-gold.conf
Currently this works perfectly, all *.bin files are deleted, the two environment variables (lines 2 and 3) are set, and then the window color is set before the cgminer.exe begins. cgminer.exe runs inside the command prompt window.

Now what I am trying to do (and failing at) is make it so that the cgminer.exe runs at higher CPU priority. I am trying to make it run at "ABOVENORMAL" or "HIGH" priority but am not sure how to make that happen and also keep the window color.

Could anyone assist please? Thank you very much!


My System SpecsSystem Spec
.
02 Feb 2014   #2
TanyaC

Linux Mint 17 Cinnamon | Win 7 Ult x64
 
 

Hi,

IIRC, the CPU priority can be set from the START command.. Here is the help text..

Code:
C:\Users\Tanya>help start
Starts a separate window to run a specified program or command.

START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
      [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
      [/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] [/B]
      [command/program] [parameters]

  ...
    LOW         Start application in the IDLE priority class.
    NORMAL      Start application in the NORMAL priority class.
    HIGH        Start application in the HIGH priority class.
    REALTIME    Start application in the REALTIME priority class.
    ABOVENORMAL Start application in the ABOVENORMAL priority class.
    BELOWNORMAL Start application in the BELOWNORMAL priority class.
    NODE        Specifies the preferred Non-Uniform Memory Architecture (NUMA)
                node as a decimal integer.
    AFFINITY    Specifies the processor affinity mask as a hexadecimal number.
                The process is restricted to running on these processors.

                The affinity mask is interpreted differently when /AFFINITY and
                /NODE are combined.  Specify the affinity mask as if the NUMA
                node's processor mask is right shifted to begin at bit zero.
                The process is restricted to running on those processors in
                common between the specified affinity mask and the NUMA node.
                If no processors are in common, the process is restricted to
                running on the specified NUMA node.
    WAIT        Start application and wait for it to terminate.
    command/program
                If it is an internal cmd command or a batch file then
                the command processor is run with the /K switch to cmd.exe.
                This means that the window will remain after the command
                has been run.

                If it is not an internal cmd command or batch file then
                it is a program and will run as either a windowed application
Press any key to continue . . .
Given that, you need to prefix the command to run cgminer.exe with the start command...

START "CGMINER" /HIGH "C:\Users\user\Desktop\MineIt\cgminer.exe --config C:\Users\user\Dropbox\Lima\gigabyte-gold.conf"

It's been a loooong time since I used this.. so hopefully I've remembered it correctly, but I've not used it in conjunction with the color command, so I can't comment on that. Fingers crossed

hth
Tanya
My System SpecsSystem Spec
Reply

 Trying to edit a batch file to run with a higher CPU priority




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Problem with batch file command to edit registry
reg add HTLM\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DontDisplayLastUserName /t REG_DWORD 00000001 /f I am trying to hide all users at logon and I know this is where you change it but for some odd reason the syntax is wrong and I can not figure it out. Can someone please...
Customization
How to run a batch file at logoff & some batch scripting help please
Hiya, I'd just like to run a simple batch file at logoff to backup some settings. I plan to use Robocopy, which is what i use to more thorough backups. Two questions: 1. How make it run by clicking Start > Shutdown? (i realise i could make a shutdown batch file and run it instead, but i'd...
Backup and Restore
software to batch edit camera model EXIF
hi guys, i have a not so expensive camera which records its model as three different cameras in the Camera Model section of the EXIF data on all of my photos. As a flickr user I feel this looks pretty silly on your profile and all batch editors of EXIFs seem to miss this feature out as it is one...
Music, Pictures & Video
Am I able to do this. Launch a program at a higher default priority?
Hi all, I am wondering if there is a way in windows 7 home premium 64-bit to say, have 7-zip's priority be set to high anytime the program is launched by using the 7-zip.exe or by double clicking a compressed file. Is this doable some how?
General Discussion
Batch File that grabs file names from folder to insert into batch file
Ok I'm totally at a loss on how to word this so I'm just going to write it out the best that I can... :confused: First I have a batch file that I'm writing that will convert mp4 files to mp3 files (I have a lot) for a buddies band using ffmpeg. Here's the code that I'm using: ffmpeg -i...
General Discussion
Edit Services with Batch File
Is there a way to make a batch file that will automatically change Services? My main goal here is to 1 click edit all the services I change from disable,automatic, and delayed. I use the same settings for the entire family that I am tech support for so it makes life easier. Anything I can do...
Performance & Maintenance


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 00:09.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App