Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

About Automatic Shutdown

Status
Not open for further replies.

erol

Technical User
Sep 20, 2002
1
TR
I happened to read one of your discussions about the Automatic Shutdown for Win9x(with ljw) and I tried it with my own PC and it worked out great. I even tried it on the task scheduler and set it to execute on a specific time and it was great especially for people like me who would always download big files and leave my Windows running at night.

I am very familiar with the
C:\Windows\RUNDLL.EXE user.exe,exitwindows
command, but these two below seems to confuse me...

rundll32.exe Shell32.dll,SHExitWindowsEx 5
and
rundll32.exe Shell32.dll,SHExitWindowsEx 13

could you enlighten me bout the difference of these two from the usual

C:\Windows\RUNDLL.EXE user.exe,exitwindows

command.... and what's the difference between the 5 and the 13?

I'm kinda new to this... please help :) thanks!

could you please, please send your reply to this addres... thanks again guys!

/erol
 
Copy this rundll32.exe Shell32.dll,SHExitWindowsEx 5 to the clipboard and paste it into google.com....I got many hits.

Cougargif.GIF
email Cougar_01@hotmail.com
 
erol,

The values can be added together:

Via the SHExitWindowsEx
Using the User.exe & User32.dll Exit Windows functions doesn't allow any control over what type of shutdown is preformed as parameters aren't passed, they operate as if 0 is passed - which is shutdown for ExitWindows and Logoff for ExitWindowsEx. An undocumented function SHExitWindowsEx in Shell32.dll which is what Explorer seems to use does take parameters.

rundll32.exe shell32.dll,SHExitWindowsEx [optional number in hex]
Action Value in Hex
EWX_LOGOFF 0
EWX_SHUTDOWN 1
EWX_REBOOT 2
EWX_FORCE 4
EWX_POWEROFF
for machines that turn off their own power 8

These values can be added together, eg, 5 is shutdown and force applications to close and an implicit logoff.

Note their is no Restart without rebooting. This requires a parameter of 42 (hex) to be passed to ExitWindows in User.exe. This can't be done from the command line. See tip above for a work around.

reghakr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top