may try
String command = ""; ( click here for shutdown_command )
Process child = Runtime.getRuntime().exec(command);
Or may be try one of these ...
Try one of these (they've both worked, but there might be problems with one - too long ago, don't remember, though )
C:\WINDOWS\RUNDLL32.EXE SHELL32.DLL,SHExitWindowsEx 1
C:\WINDOWS\RUNDLL32.EXE user,exitwindows
10 comments:
pic and well handled....Lolz
ya best is write the command in a batch file and call the batch file from java. Respect all OS as well. so dont forgot to add:
os.name check
You can use JWSF (Java Windows Shutdown Functions) to shutdown,reboot,log-off, and lock any 32bit windows system.
Link: http://jwsf.sourceforge.net/
You can use JWSF (Java Windows Shutdown Functions) to shutdown,reboot,log-off, and lock any 32bit windows system.
Link: http://jwsf.sourceforge.net/
thanks for the info buddy
Try the link for best Shutdown help
Click here
Runtime.getRuntime().exec("shutdown -r -t 5");
-t: seconds to wait before rebooting
Runtime.getRuntime().exec("shutdown -r -t 5");
-t: seconds to wait before reboot
thanks for the comment
RUNDLL32.EXE SHELL32.DLL,SHExitWindowsEx 1
works only on win98
Post a Comment