If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Threaded View

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?