Método Shell.ShutdownWindows

Exibe a caixa de diálogo Desligar o Windows . Isso é o mesmo que clicar no menu Iniciar e selecionar Desligar.

Sintaxe

iRetVal = Shell.ShutdownWindows()

Shell.ShutdownWindows() As Integer

Parâmetros

Esse método não tem parâmetros.

Exemplos

O exemplo a seguir mostra ShutdownWindows em uso. O uso adequado é mostrado para JScript, VBScript e 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

Requisitos

Requisito Valor
Cliente mínimo com suporte
Windows 2000 Professional, Windows XP [somente aplicativos da área de trabalho]
Servidor mínimo com suporte
Windows 2000 Server [somente aplicativos da área de trabalho]
Cabeçalho
Shldisp.h
IDL
Shldisp.idl
DLL
Shell32.dll (versão 4.71 ou posterior)