Running a command from a jar file
Hi, guys. I hope you can help me. I've already done some search and didn't find a satisfying answer. I know, its probably a very stupid problem, but I just don't know what to do.
So, here it is:
I've got an application which is silently running on a computer A. I've got also another application on a computer B. Using this application I can remotely restart/log of/shutdown computer A. The action is performed by shutdown.exe + parameters which I specify on the computer B. EVERYTHING WORKS PERFECTLY as long as I don't create *.jar files. Running from *.jar archives everything works up to the point when the shutdown command should be executed. I always end up with java.io.IOException: CreateProcess: shutdown.exe /r /t 60 /c "comment" error=2.
I also know that Runtime.exec() is NOT a command line, so what should I do to make it run directly from *.jar? :SICK:
This restarts the computer A:
Runtime.getRuntime().exec("shutdown " + receivedCommand + " /t " + delay + " /c \"" + comment + "\"");
This allows the user of the computer A to abort the shutdown if necessary:
OS: Win Xp
JRE 5.0 Update 6
Thanks for any help.