Can you set process priority for an exe?

D

dean

Hello all,

I regularly run Borland's compiler (CBuilder 6.0) at work as a full
time developer, but when it compiles it hogs nearly all of the
machine's CPU time, and all other apps are very unresponsive. If I set
the priority level of the process to LOW, then everything works fine
and the program still runs just the same.

How can I set the priority level on an application such as this? I
right-click on the shortcut and can't see anything related to priority
levels.

Thanks!


Dean
 
D

DeanB

Hello all,

I regularly run Borland's compiler (CBuilder 6.0) at work as a full
time developer, but when it compiles it hogs nearly all of the
machine's CPU time, and all other apps are very unresponsive. If I set
the priority level of the process to LOW, then everything works fine
and the program still runs just the same.

How can I set the priority level on an application such as this? I
right-click on the shortcut and can't see anything related to priority
levels.

Thanks!

Dean

I should have asked: How can I make it automatically set the priority
level, when I open the application.
 
3

3c273

Create a batch file with the following line:

start /LOW x:\pathtoyourprogram.exe

and use that to start your program. Open a command prompt and type "start
/?" for more info.
Louis
 
D

DeanB

Create a batch file with the following line:

start /LOW x:\pathtoyourprogram.exe

and use that to start your program. Open a command prompt and type "start
/?" for more info.
Louis








- Show quoted text -

Thanks! I have the new batch file (BCB_LOW.bat) on my desk-top with
the following contents:

start/LOW "C:\Program Files\Borland\CBuilder6\Bin\bcb.exe"

When I double-click the icon for this .bat file, all I get is a
command prompt which takes me to the:

documents and settings\Dean\Desktop

directory.

Can you tell me what I'm missing here? I copied the path over from the
properties dialog for the app itself.

-Dean
 
B

Bob I

DeanB said:
Thanks! I have the new batch file (BCB_LOW.bat) on my desk-top with
the following contents:

start/LOW "C:\Program Files\Borland\CBuilder6\Bin\bcb.exe"

When I double-click the icon for this .bat file, all I get is a
command prompt which takes me to the:

documents and settings\Dean\Desktop

directory.

Can you tell me what I'm missing here? I copied the path over from the
properties dialog for the app itself.

-Dean

A few things, I presume there is a space between your "start" and
"/LOW". You have the shortcut on the desktop, do you have the start in
folder set? Does not sound like it. Also this application, does it need
parameters? Or a file passed to it?
 
3

3c273

I'm not sure what is going on. I also get this behavior on my Win2k box but
my WinXP box is working as expected. If I find a solution, I will post back.
Louis
 
D

DeanB

I'm not sure what is going on. I also get this behavior on my Win2k box but
my WinXP box is working as expected. If I find a solution, I will post back.
Louis











- Show quoted text -

There was no space, but I added one and it didn't work either.

Here are the properties of my compiler icon:

Target: "C:\Program Files\Borland\CBuilder6\Bin\bcb.exe"

Start In: "C:\Program Files\Borland\CBuilder6\Bin"

Run: Normal Window


-DeanB
 
N

Nepatsfan

In
DeanB said:
Thanks! I have the new batch file (BCB_LOW.bat) on my
desk-top with
the following contents:

start/LOW "C:\Program Files\Borland\CBuilder6\Bin\bcb.exe"

When I double-click the icon for this .bat file, all I get is
a
command prompt which takes me to the:

documents and settings\Dean\Desktop

directory.

Can you tell me what I'm missing here? I copied the path over
from the
properties dialog for the app itself.

-Dean

You might want to try the following;

Right click BCB_LOW.bat and select Edit from the menu.
Delete the contents.
Copy and paste the following command into Notepad.

Start /LOW C:\"Program Files\Borland\CBuilder6\Bin\bcb.exe"

Save the batch file to your desktop and see if it works now.

Good luck

Nepatsfan
 
3

3c273

Good catch. By any chance, do you know why the path needs to be quoted in
this fashion? Seems somewhat unconventional.
Louis
 
D

DeanB

Good catch. By any chance, do you know why the path needs to be quoted in
this fashion? Seems somewhat unconventional.
Louis












- Show quoted text -

It worked! The quotes were there because I copied them from the Target
item above (quotes are around the entire path.) When I moved them in
the batch file as recommended, it worked perfectly, and it starts up
in LOW priority.

Many thanks to all!

Dean
 
B

Bob I

DeanB said:
There was no space, but I added one and it didn't work either.

Here are the properties of my compiler icon:

Target: "C:\Program Files\Borland\CBuilder6\Bin\bcb.exe"

Start In: "C:\Program Files\Borland\CBuilder6\Bin"

Run: Normal Window


-DeanB

Perhaps use the /wait parameter and see if the compiler is still running?
 
N

Nepatsfan

It worked! The quotes were there because I copied them from
the Target
item above (quotes are around the entire path.) When I moved
them in
the batch file as recommended, it worked perfectly, and it
starts up
in LOW priority.

Many thanks to all!

Dean

You're welcome.

Nepatsfan
 
N

Nepatsfan

In
3c273 said:
Good catch. By any chance, do you know why the path needs to
be
quoted in this fashion? Seems somewhat unconventional.
Louis

Sorry, I don't know why it works that way. I ran into the same
problem the OP had once and stumbled over the solution through
sheer "dumb" luck.

Nepatsfan
 
D

DeanB

In


Sorry, I don't know why it works that way. I ran into the same
problem the OP had once and stumbled over the solution through
sheer "dumb" luck.

Nepatsfan




- Show quoted text -

Its because of the space isn't it? DOS must think its two different
paths or commands.
 
V

Vanguard

in message
I have the new batch file (BCB_LOW.bat) on my desk-top with
the following contents:

start/LOW "C:\Program Files\Borland\CBuilder6\Bin\bcb.exe"

When I double-click the icon for this .bat file, all I get is a
command prompt which takes me to the:

documents and settings\Dean\Desktop

directory.

Can you tell me what I'm missing here? I copied the path over from the
properties dialog for the app itself.

It's a parsing problem. Look again at the syntax shown when you run
"start /?" in a DOS shell. Notice there is a title parameter and a
command parameter. The title parameter, if used, requires it to be
enclosed in double quotes. However, if you omit the title parameter but
the command parameter requires it to be double-quoted due to spaces then
the start command will see the double-quoted command parameter as the
title parameter. The cure is to specify both the title and command
parameters, as in:

start "your_title" /low "command with embedded spaces"
 
N

Nepatsfan

In
DeanB said:
Its because of the space isn't it? DOS must think its two
different
paths or commands.

If you're referring to the space between Start and /LOW, that
wasn't a problem. Having Start/LOW as the command portion of
the line in your batch file wouldn't be a problem.

If you're talking about the space between Program and Files,
yes, that's where the problem starts.

As I think you know, standard practice when there's a space
within the path to a file or program is to enclose the entire
path in quotation marks. That applies to XP's command
environment as well as DOS. Without the quotes, you get an
error message such as Windows can't find 'C:\Program'. BTW,
there's no DOS in XP.

For some reason, and I don't know why, the Start command
requires that the first quotation mark in a path which has a
space must come after the drive portion of the path. You're
original batch file had the quotation mark before C:\ like
this;

"C:\Program Files\Borland\CBuilder6\Bin\bcb.exe"

That resulted in you're launching a command prompt window. It
was as if Windows didn't even see the program portion of your
batch file entry.

When you move the first quotation mark after C:\, as in
C:\"Program Files\Borland\CBuilder6\Bin\bcb.exe", the batch
file works properly. C:\"Program
Files"\Borland\CBuilder6\Bin\bcb.exe, where only the portion of
the path with the space is enclosed in quotes, would work as
well.

Nepatsfan
 
D

DeanB

in message













It's a parsing problem. Look again at the syntax shown when you run
"start /?" in a DOS shell. Notice there is a title parameter and a
command parameter. The title parameter, if used, requires it to be
enclosed in double quotes. However, if you omit the title parameter but
the command parameter requires it to be double-quoted due to spaces then
the start command will see the double-quoted command parameter as the
title parameter. The cure is to specify both the title and command
parameters, as in:

start "your_title" /low "command with embedded spaces"- Hide quoted text -

- Show quoted text -

Ok! Thanks for the updates.
 
A

Ayush

[DeanB] wrote-:
Thanks! I have the new batch file (BCB_LOW.bat) on my desk-top with
the following contents:

start/LOW "C:\Program Files\Borland\CBuilder6\Bin\bcb.exe"

Try:
start /low "" "C:\Program Files\Borland\CBuilder6\Bin\bcb.exe"

The first parameter should be title. When you run
start/LOW "C:\Program Files\Borland\CBuilder6\Bin\bcb.exe"
the start command thinks that the exe path is title not the file to run that's why it
doesn't work.


Good Luck, Ayush.
 
3

3c273

Thanks for the explanation.
Louis

Ayush said:
[DeanB] wrote-:
Thanks! I have the new batch file (BCB_LOW.bat) on my desk-top with
the following contents:

start/LOW "C:\Program Files\Borland\CBuilder6\Bin\bcb.exe"

Try:
start /low "" "C:\Program Files\Borland\CBuilder6\Bin\bcb.exe"

The first parameter should be title. When you run
start/LOW "C:\Program Files\Borland\CBuilder6\Bin\bcb.exe"
the start command thinks that the exe path is title not the file to run that's why it
doesn't work.


Good Luck, Ayush.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top