How can i initiate a shutdown (CTRL+ALT+DEL) without using JNI on my Windows box?

Davanum Srinivas

You can call Runtime.exec() and execute rundll32.exe with a few parameters.

rundll32.exe shell32.dll,SHExitWindowsEx   (to close the session)
rundll32.exe shell32.dll,SHExitWindowsEx 2 (to reboot)
rundll32.exe shell32.dll,SHExitWindowsEx 3 (to power down)
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact