Condividi tramite


Metodo Shell.EjectPC

Espelle il computer dalla sua stazione di ancoraggio. Equivale a fare clic sul menu Start e selezionare Eject PC (Eject PC), se il computer supporta questo comando.

Sintassi

Shell.EjectPC()

Shell.EjectPC()

Parametri

Questo metodo non presenta parametri.

Valore restituito

JScript

Questo metodo non restituisce valori.

VB

Questo metodo non restituisce valori.

Esempio

L'esempio seguente mostra EjectPC in uso. Viene visualizzato un utilizzo appropriato per JScript, VBScript e Visual Basic.

Jscript:

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

Vbscript:

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

        set objShell = nothing
    end function
 </script>

Visual Basic:

Private Sub fnShellEjectPCVB()
    Dim objShell As Shell
    
    Set objShell = New Shell
    objShell.EjectPC

    Set objShell = Nothing
End Sub

Requisiti

Requisito Valore
Client minimo supportato
Windows 2000 Professional, Windows XP [solo app desktop]
Server minimo supportato
Windows 2000 Server [solo app desktop]
Intestazione
Shldisp.h
IDL
Shldisp.idl
DLL
Shell32.dll (versione 4.71 o successiva)