jOhn
7/13/2005 12:45:00 AM
Forgive my newbness :)
I am attempting to fire up a dos batch file, like for example startup a
jboss server instance.
In my *.rb script, I have this straight snippet:
puts %x{ c:/zone/jboss-4.0.1sp1/bin/run.bat -c node1 }
It works when I hard-code the path and args as in the sample above.
The path and path-args are hard-coded, because I can't figure out how to
pass in a variable and still get the server to start.
I have tried these:
puts %x{ printf "%s/bin/run.bat -c %s", serverPath, nodeName }
puts %x{ serverPath + "/bin/run.bat -c " + nodeName }
print %x{ serverPath + "/bin/run.bat -c " + nodeName }
and all kinds of others, so how to make the magic? How would you launch a
narly .bat file with a bunch of args and slashes passed along?
Also, is there a way to fire the DOS batch file and not have the script
pause for the process to finish ... so a non-blocking dos call?
Thanks.
-John A