Shell.ShutdownWindows method

Displays the Shut Down Windows dialog box. This is the same as clicking the Start menu and selecting Shut Down.

Syntax

iRetVal = Shell.ShutdownWindows()

Shell.ShutdownWindows() As Integer

Parameters

This method has no parameters.

Examples

The following example shows ShutdownWindows in use. Proper usage is shown for JScript, VBScript, and Visual Basic.

JScript:

<script language="JScript">
    function fnShellShutdownWindowsJ()
    {
        var objShell = new ActiveXObject("shell.application");
        
        objShell.ShutdownWindows();
    }
</script>

VBScript:

<script language="VBScript">
    function fnShellShutdownWindowsVB()
        dim objShell
        
        set objShell = CreateObject("shell.application")
        objShell.ShutdownWindows

        set objShell = nothing
    end function

Visual Basic:

Private Sub fnShellShutdownWindowsVB()
    Dim objShell As Shell
    
    Set objShell = New Shell
    objShell.ShutdownWindows

    Set objShell = Nothing
End Sub

Requirements

Minimum supported client
Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Shldisp.h
IDL
Shldisp.idl
DLL
Shell32.dll (version 4.71 or later)