C
christopher_board
Hi all. I want to be able to shutdown remote computers using Java.
Below are the things that have been imported :
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.rmi.*;
import java.rmi.server.*;
import javax.swing.*;
and below is the code
public void remoteShutdown_actionPerformed(ActionEvent e) {
try{
Runtime.getRuntime().exec("shutdown -m \\toshiba_cwb -s -t
99");
}catch(Exception ex){System.out.println("Fail to
ShutDown"+ex);}
The code works fine without the the -m and the computer name, however
when I put the -m \\computerName it won't shut the computer down but
no error messages have been displayed.
What is wrong with this.
Any help in this matter would be truly appreciated.
Below are the things that have been imported :
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.rmi.*;
import java.rmi.server.*;
import javax.swing.*;
and below is the code
public void remoteShutdown_actionPerformed(ActionEvent e) {
try{
Runtime.getRuntime().exec("shutdown -m \\toshiba_cwb -s -t
99");
}catch(Exception ex){System.out.println("Fail to
ShutDown"+ex);}
The code works fine without the the -m and the computer name, however
when I put the -m \\computerName it won't shut the computer down but
no error messages have been displayed.
What is wrong with this.
Any help in this matter would be truly appreciated.