On 30 Mar 99, at 12:38, John O Wilson wrote:
> A while back, someone offered the information below to allow an icon (or
> program, for that matter) to shut down Windows. I believe someone else
> asked if there was a similar command to allow a restart, but I don't think
> anyone responded. Anyone happen to know?
>
>
> On Fri, 12 Mar 1999, Shyamal Gupta wrote:
>
> > A simple way is to create this shortcut on your desktop. In the command
> > line, enter the following :
> >
> > C:\WINDOWS\RUNDLL.EXE user.exe,exitwindows
ExitWindows is a function implemented inside user.exe, but exported
and used as a DLL call. Shutting down Windows is all it can do.
ExitWindows actually expects to receive two parameters, which are
reserved and supposed to be zero. I don't know how RUNDLL.EXE is
providing these.
There is another function in USER.EXE called ExitWindowsEx.
Parameter sizes/types are similar, but one of them is used to pass
flags specifying logoff, shutdown, power-off, reboot, and force even if
some apps don't want to close. [Under NT, many of these will only work
if your account has "Shut down the machine" rights...]
If we knew of a way to pass parameters through RUNDLL.EXE, then the
trick above could easily be expanded into a whole family of subtle
variants. Without that, it shouldn't be too hard to write a very small
program that takes options from the command line (so you can put
shortcuts specifying particular options on your desktop); I might be
able to crank out such a thing this week....
David G
Curious about the people moderating your
messages? Visit our staff web site:
http://nospin.com/pc/staff.html
|