Forcing Shutdown in Win2000 without using shutdown.exe

M

Matthew

Hi all,

Anyone know of a way to shut Win2000 down from within a
batch file without using shutdown.exe? I figure it uses
the exitwindowsex function but unfortunately have no idea
of the syntax used.

Cheers,

Matt
 
J

John Phillips

I believe there's no way to do this without using a tool of some sort. Many
people will point to rundll32 as in "rundll32 user32,ExitWindows", however
this will not work in Windows 2000 or higher, as ExitWindows(Ex) requries
the SE_SHUTDOWN_NAME privilege, which isn't given to processes by default.
Any process which needs to shutdown Windows needs to adjust the
privileges -=before=- calling ExitWindows(Ex)

(Actually, MSDN makes no mention that ExitWindows requires SE_SHUTDOWN_NAME,
however the clever will note that ExitWindows() is #defined to ExitWindowsEx
in WinUser.h).

Long story short, you're going to need shutdown.exe (or another tool, such
as one you write yourself).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top