Re: Get error message from Command prompt



christopher_board@xxxxxxxxxxx wrote:

Hi all.

I am currently trying to develop a java applicatio that will enable me
to shutdown or restart computers remotely. I am doing this by using
the command prompt code in order to perform the shutdown. For example
I am using shutdown -m \\computer name -r -f -t 30.

When I run this code in the command prompt and the computer cannot be
found on the network it comes up with a message saying that the
network path was not found. How can I read in the error message that
the command prompt provides from within my Java Application.

Does Windows cmd.exe support command pipes? If it does you can run one command
and pipe the output of that into another executable's standard input. The
second application just reads the data on its standard input.


Any help in this matter would be highly appreciated.

Try piping (if cmd.exe supports) command output to a java application and see
what it reads.

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@xxxxxxxxxxxx
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
.



Relevant Pages

  • Re: Visual Studio 2005
    ... Maybe the command prompt compiler is set to include the full C# 2.0 ... that the Java command line compiler is set ... In the command prompt and in the Java IDEs I have used, ... In the top of a file, you are declaring which namespaces to use. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: cant play knights online
    ... Open a command prompt and type "java -version". ... doesn't recognize the command you may have to download a Java interpreter ... cos of viruses, since then ive tried to download it again from gamespot and ...
    (microsoft.public.windowsxp.games)
  • Re: Do Java CLI commands work on Windows?
    ... but lately I have been experimenting with the "Command Prompt" on ... I am under the impression -which I would obviously like to ... My Linux server is running and ancient, non-Sun version of Java, hence ... The Environment variable named CLASSPATH may be alternatively used to ...
    (comp.lang.java.programmer)
  • Re: Simple JavaScript IDE
    ... Rhino's current Java binaries are located at: ... Unzip them into the folder of your choice, open a command prompt, cd ... Building SpiderMonkey under Cygwin is kind of a pain; ... Mozilla team built the Windows install assuming a Visual Studio ...
    (comp.lang.javascript)
  • Re: Adding CMD to right click on desktop
    ... You could also set the Power Options to do "Shutdown" when you press Power Button. ... Having a command prompt may or may not make a difference, but it would be nice to know. ... I could program in a batch file to run the shutdown command to perform a clean restart. ... adding static context menu items to the Desktop is not possible in Windows 9x/XP. ...
    (microsoft.public.windowsxp.general)