File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes How to shutdown windows 98/2000  from java program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic

How to shutdown windows 98/2000 from java program

yoursrini vasan

Joined: Aug 21, 2004
Posts: 2
I want to check out the user should not close my login screen , if he try to close it means the os should restart or shutdown (try for win98/2000) only. Pls help me now

Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Did you think about the unsaved work, the user might have, which you're going to damage by shutting down?

Shall this be a kind of virus?
How to prohibit the user using the task-manager to kill your app?

Java isn't made for such ugly and unresponsible behaviour.
You need at least some close-to-the os code - native c/c++ or Runtime.exec - to call.

But it's unresponsible.
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
I can imagine that there may well be sincere security concerns for what yoursrini vasan is trying to do.

As suggested, I don't think you'll be able to figure out a strictly Java-based solution. For help figuring out any Windows-specific system calls, I suggest that you mosey on over to the General Computing forum and ask a question. For help figuring out using JNI to make any Windows-specific system call, mosey on over to the Other Java APIs forum.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link:
subject: How to shutdown windows 98/2000 from java program
It's not a secret anymore!