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


  1. Posts : 1
    Windows 7 Pro x64
       #1

    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 Computer


  2. Posts : 784
    Linux Mint 17 Cinnamon | Win 7 Ult x64
       #2

    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 Computer


 

  Related Discussions
Our Sites
Site Links
About 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 04:20.
Find Us