Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Remote shutdown help needed!

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Remote shutdown help needed!

    Hello all, I'm new to the forum and would really appreciate some help in writing code to remotely shutdown another laptop. Here is the code so far:

    import java.io.IOException;
     
    class remoteSD {
        public static void main(String[] args) throws IOException {
            Runtime.getRuntime().exec("shutdown /s /m <comp name here>);
        }
    }

    I get no errors but nothing happens... What exactly am I doing wrong? Any help would be greatly appreciated.


  2. #2
    Junior Member
    Join Date
    Nov 2012
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Remote shutdown help needed!

    Wouldn't a script be more suitable?

Similar Threads

  1. ShutDown from JButton
    By mija in forum What's Wrong With My Code?
    Replies: 7
    Last Post: July 7th, 2012, 01:08 PM
  2. Shutdown Remote Computer using java....
    By pupivama in forum Member Introductions
    Replies: 1
    Last Post: May 8th, 2012, 07:44 AM
  3. Replies: 0
    Last Post: October 13th, 2011, 07:05 PM
  4. Replies: 1
    Last Post: November 9th, 2010, 09:58 AM
  5. remote system shutdown
    By prince joseph in forum What's Wrong With My Code?
    Replies: 0
    Last Post: March 28th, 2010, 02:35 AM