Shutdown Computer using VBScript 
Author Message
 Shutdown Computer using VBScript

Quote:

> How could I shutdown a computer using VBScript

Use the Shell.Run method to access an appropriate function in a a DLL
via rundll32.exe, say something like this ...

  with CreateObject("Wscript.Shell")
    .Run "C:\WINDOWS\RUNDLL32.EXE shell32.dll,SHExitWindowsEx 2", 0,
False
  end with

This only works on machines that have Active Desktops loaded, which
include some machines where IE 4.0 is or was loaded and all Win 98
machines.

Others I have collected of the 'net are ...

Windows 98:

Closes all programs and prompts you to log on:
  rundll32.exe shell32.dll,SHExitWindowsEx

This powers down the system on laptops and systems equipped with ATX
power supplies:
  rundll32.exe shell32.dll,SHExitWindowsEx 5

Reference URL for preceding items:
http://www.*-*-*.com/

From other sources for Win 9x:

  rundll32.exe User.exe,ExitWindowsExec 5        % restarts %
  rundll32.exe User.exe,ExitWindows              % shuts down %

Also a reboot for Win 9x:
Ref: microsoft.public.scripting.vbscript, "Mark L. Ferguson"

  rundll.exe user.exe, ExitWindowsExec EW_REBOOTSYSTEM , 0

In all cases, the text after the comma is case sensitive!

Tom Lavedas
-----------
http://www.*-*-*.com/ ~tglbatch/



Sun, 02 Mar 2003 03:00:00 GMT  
 Shutdown Computer using VBScript

How could I shutdown a computer using VBScript



Sun, 02 Mar 2003 23:17:05 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to shutdown the computer using VB5

2. [Fwd: How to shutdown the computer using VB5]

3. Shutdown windows using vbscript

4. Using a vbscript to shutdown/start a service through ASP

5. Shutdown computer?

6. Can I shutdown computer with WSH?

7. How to shutdown the computer with WSH

8. How to create foreign computers using Vbscript?

9. Shutdown computer

10. Can anybody send VB.net Code to shutdown or restart local computer for me

11. Shutdown computer??

12. Code to interrupt computer shutdown

 

 
Powered by phpBB® Forum Software