Re: Windows priorities with runtime.exec

Daniel Pitts <newsgroup.spamfilter@xxxxxxxxxxxxxxxxxxx> wrote in

On 6/7/2010 12:41 PM, Ian Shef wrote:
Hakan<H.L@xxxxxxxxxxxx> wrote in

In order to run a SAS job from a Java program, we are using a simple
That works great, but my boss wants to have it run with a set lower
priority so that it doesn't interrupt other tasks on the server. How
do I do that?

Your example has bad capitalization and will not compile. However...

I have not tried this, but I am going to guess that the solution
involves the "start" command. If you have Windows XP, you might try:

Runtime.getRuntime.exec({"C:/WINDOWS/system32/cmd.exe", "/C", "START",
"/BELOWNORMAL", "C:\\Program Files\\sas.exe", "myloc/"}) ;

I have turned some forward slashes into double backslashes.
Backslashes are needed to meet the expectations of the START command,
and doubling is required for Java strings.

I don't have the right environment to try this, but perhaps it is close
enough to give someone an idea. Perhaps there is an easier way.

Good luck!

Sounds reasonable, although I would suggest wrapping the whole thing in
a BAT file, to separate the "priority" of the running app from the
concern of the runner app.

Even better than my solution. I like it!