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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatic Shutdown 1

Status
Not open for further replies.

ljwmis

MIS
May 23, 2001
48
GB
I have several Compaq Deskpro EN PCs running Windows 95 over an NT network.

Until recently all PCs shutdown automatically i.e. the MS Windows closing down message, followed by a complete power off - cpu and monitor.

This configuration was changed during a virus software update, so the PCs no longer power off, they display the message "it is safe to shutdown your PC" and you need to physically turn the PC off.

I have created the shortcut "C:\Windows\RUNDLL.EXE user.exe,exitwindows" and it works great to a point, but it still stops at the "safe to turn off" message - without the final power off.

How do I configure the PCs to shutdown and power off? Thanks.
 
Try this one, not sure if it's only Win98

c:\windows\rundll.exe shell32.dll,SHExitWindowsEx 5

reghakr
 
Thanks reghakr for your quick response.

Tried your suggestion "c:\windows\rundll.exe shell32.dll,SHExitWindowsEx 5" but no luck. Error message "error in shell.dll - missing entry:shexit windowsex".

Think this must be Windows98 specific.

Still looking for a solution.

 
Hello, ljw.

I think it was just a typo. Should use rundll32.exe instead of rundll.exe. Hence the line should be read as :

rundll32.exe Shell32.dll,SHExitWindowsEx 5

Also, [1] SHExitWindowsEx is case-sensitive, and [2] no space is allowed between "Shell32.dll," and "SHExitWindowsEx".

regards - tsuji

 
Hello, again.

Like to add another note.

[1] As your PC's had been performing as anticipated with power-off after:

rundll.exe user.exe,ExitWindows
(_mind the case-sensitivity of ExitWindows and rundundant empty space_)

So you should make sure that the power-off support feature has not been disabled at present by any chance.

[2] If [1] and the proposed rundll32 commandline still do not work, and that rundll32 works up to the power-off, then try instead :

rundll32.exe Shell32.dll,SHExitWindowsEx 13
(changing the parameter from 5 to 13)

regards - tsuji
 
Thanks tsuji,

The problem is cleared.

It was solved when I rebooted the PC, entered <setup> (pressing F10) and changed the power settings to minimal, saved changes and exited. The PC now powers down and switches off as required.

Thanks to everyone who contributed the short cuts are great.

ljw
 
I was just wondering if there's a way to shut down my computer through a batch file, so I don't have to go &quot;start&quot; then &quot;shutdown&quot; then &quot;shutdown&quot;. Is it possible for to just double click on a batch file and it would shut down a computer?
 
If you create a shortcut on the desktop, you can use reghakrs suggestion to close down. That is put

rundll32.exe Shell32.dll,SHExitWindowsEx 5

in the target line of the shortcut.
 
Is there a way to see all the possible dll's which can be run by run32dll.exe and especially a way to see the methods and according parameters which can be evoked within a certain dll.
 
That would take a large amount of trial & error experimenting.

You would first have to find the method o action inside the DLL file. A utility such as Dependency Walker would help you out. Here's a link:

Here's a small I came up with:
Open Control Panel applets:
rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1
rundll32.exe shell32.dll,Control_RunDLL %1,%*

Disable or enable the entire keyboard:
rundll32 keyboard,disable
rundll32 keyboard,enable

Generate a typelib
&quot;C:\WINDOWS\RUNDLL32.EXE&quot; C:\WINDOWS\SYSTEM\SCROBJ.DLL,GenerateTypeLib &quot;%1&quot;

Unknown, working on:
rundll32.exe advpack.dll,RegisterOCX %s,%s,%s

Change printing from Office to IE:
rundll32.exe C:\WINDOWS\SYSTEM\MSHTML.DLL,PrintHTML &quot;%1&quot;&quot;

Restore standard file associations
rundll setupx.dll,InstallHinfSection DefaultInstall 132 c:\windows\inf\shell.inf
and to repair internet file associations, and problems with previewing images.

Run Internet Explorer maintenance:
rundll32 setupwbv.dll,IE5Maintenance
or
rundll32 setupwbv.dll,IE5Maintenance &quot;C:\Program Files \Internet Explorer\Setup\SETUP.EXE&quot; /g &quot;C:\WINDOWS\IE Uninstall Log.Txt&quot;

in Windows ME:
rundll32 mydocs.dll,RestoreMyDocsFolder

RUNDLL.EXE - SHUTDOWN, LOGOFF, RESTART, OR REBOOT
c:\windows\rundll.exe user.exe,ExitWindows ;Shut down, or
c:\windows\rundll.exe shell32.dll,SHExitWindowsEx 5 ;Shut down
c:\windows\rundll.exe shell32.dll,SHExitWindowsEx ;Log-off user
c:\windows\rundll.exe user.exe,ExitWindowsExec ;Restart
c:\windows\rundll.exe shell32.dll,SHExitWindowsEx 2 ;Reboot

Then there are these MS Knowledge Base Articles:
Q164787 - INFO The Windows 95 Rundll and Rundll32 Interface
Q166168 - HOWTO Use RUNDLL32 to Debug Control Panel Applets

reghakr
 
Thanks, reghakr!

The dependencywalkerprogram seems to be very useful.

A quick glimpse in the manual learned me that ,like you said, most of the time the parameters and returnvalues can't be seen. Only a few of the available functions are revealed, but nevertheless, this seems to be a very decent tool.

And thanks for the thorough overview of the commands known to you. If I find the meaning of RegisterOCX-command I will be glad to help you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top