Link to home
Start Free TrialLog in
Avatar of menakaindrani
menakaindrani

asked on

run cmd in background

Hi All,

I am doing the following:
Runtime.getRuntime().exec ( "cmd.exe /C start C:/lxf/ipssources/bin/integrate/covenant.bat" ) ;

Cmd pops up and I do not want it like that I want cmd to run in the background how do I do that.

Thanks
Menaka
ASKER CERTIFIED SOLUTION
Avatar of Breadstick
Breadstick

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DrWarezz
DrWarezz

You MAY be able to find something if you search at command prompt: cmd /?

However, I think your best solution would be to perform all of the commands that the batch file does, but via the Java file.

gL,
[r.D]
Ah - breadsticks idea should work :)
[r.D]
Avatar of CEHJ
Did you try just

Runtime.getRuntime().exec ( "C:/lxf/ipssources/bin/integrate/covenant.bat" ) ;

?
or you can try cmd.exe /min
>"Runtime.getRuntime().exec ( "C:/lxf/ipssources/bin/integrate/covenant.bat" ) ;"
That won't work -- because wants to start the batch file, and have it run in the background. That will just open the normal cmd window.

And the /min switch will only minimize it.

I stand by my orginial suggestion. :)

[r.D]
Running on W98? Then the MSDOS popup is simply a JAVA bug.
;JOOP!
For me, breadstick's method of "Try it without 'start'", appears to work :)

Give it a go! :D

[r.D]
hey... did u get any solution for your problem

the solution is

>>>>>>>>> or you can try cmd.exe /min

"cmd.exe /c"

this will restrict the window to popup