[Fwd: Re: Update Rebooting from Netlogon Script]

Chris Tooley ctooley at joslyn.org
Mon Jun 26 23:20:57 GMT 2000


Keith:

	This is from a thread "Update Rebooting from Netlogon Script" that came
after the other thread.  The addition to my update should fill in the
holes that mine left out.  In my opinion this should be taped to the
side of every Win 9x SysAdmin's head.  But, that's just my opinion. :)

Hope this helps.

Chris Tooley

-------- Original Message --------
Subject: Re: Update Rebooting from Netlogon Script
Date: Tue, 13 Jun 2000 09:26:04 +1000
From: David Bannon <D.Bannon at latrobe.edu.au>
Reply-To: D.Bannon at latrobe.edu.au
To: Multiple recipients of list SAMBA-NTDOM <samba-ntdom at samba.org>

At 11:12 PM 09/06/2000 +1000, Chris Tooley wrote:

>1)  Rebooting Windows 9x is a terrible pain in the butt, but it can be
>done.  I'm pretty sure that having a command called reboot that
>"reboot"s the system, would be WAY too difficult for them to understand.
>

There is a WinAPI that I use to shutdown WinNT, I have not tried it
under
w95 but my help files indicate it will work. If you are interested in a
code based solution :

        ExitWindowsEx(EWX_SHUTDOWN or EWX_FORCE, 0);

Parameters 'or'ed together include :
   EWX_LOGOFF     - Shuts down processes and logs user off
   EWX_REBOOT     - Shuts down the restarts the system
   EWX_SHUTDOWN   - Shuts down system

   The following attributes may be combined (OR'd) with above flags

   EWX_POWEROFF  - shuts down system and turns off the power.
   EWX_FORCE     - forces processes to terminate.

I expect that rundll32 makes a call to that function.

David

>
>rundll32.exe shell32,SHExitWindowsEx X
>
>where the last "X" is a number.
>
>     0 - LOGOFF
>     1 - SHUTDOWN
>     2 - REBOOT
>     4 - FORCE
>     8 - POWEROFF
>  
> Or any combination thereof, by adding the values together, giving 16
>possible shutdown/restart sequences.
>
>I wish there was a better place to document something like this as it's
>obvious that Microsoft isn't offering it up very readily.
>
>Chris Tooley
>
------------------------------------------------------------
David Bannon                      D.Bannon at latrobe.edu.au
School of Biochemistry            Phone 61 03 9479 2197
La Trobe University, Plenty Rd,   Fax   61 03 9479 2467
Bundoora, Vic, Australia, 3083    http://bioserve.latrobe.edu.au
------------------------------------------------------------
.... Humpty Dumpty was pushed !


More information about the samba-ntdom mailing list