Forums Register Login

Windows 2000 Plateform...

+Pie Number of slices to send: Send
Hi all,

Can anyone please explain how to shutdown windows 2000 using java program. Well on MSDN I found one method which can shutdown windows.

DWORD WINAPI InitiateShutdown(
LPTSTR lpMachineName,
LPTSTR lpMessage ,
DWORD dwGracePeriod,
DWORD dwShutdownFlags,
DWORD dwReason
);

Is there any dll file available for this. I found one dll file csWindowsShutdown.dll. When I load this dll, then runtime system throws an Error says mscoree.dll not found.

Is there any alternate way of doing this?

Thanks & Regards

Naseem
+Pie Number of slices to send: Send
Windows has a SHUTDOWN command, which you can execute using Runtime.exec.
+Pie Number of slices to send: Send
Thanks Ulf...

It worked as you have explained.



java Shutdown shutdown /L /T:10

This shutdown my computer in 10 seconds.

Thanks once again


Regards


Naseem
+Pie Number of slices to send: Send
If you look at the description in the Windows API reference on MSDN, it tells you in which DLL this function is: advapi32.dll.

Note that the description also says Requires Windows Vista / Requires Windows Server "Longhorn", so this is most likely not going to work on Windows 2000 anyway. You should use the function ExitWindowsEx instead.

See also: Shutting Down on MSDN.
What are your superhero powers? Go ahead and try them on this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 846 times.
Similar Threads
error in weblogic 8.1
what is dll?
Java application fails only on one machine.
Use a .dll file.
CPU usage
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 01:31:19.