Méthode IShellDispatch.EjectPC

Éjecte l’ordinateur de sa station d’accueil. Cela revient à cliquer sur le menu Démarrer et à sélectionner Éjecter le PC, si votre ordinateur prend en charge cette commande.

Syntaxe

IShellDispatch.EjectPC()

IShellDispatch.EjectPC()

Paramètres

Cette méthode n’a aucun paramètre.

Valeur retournée

JScript

Cette méthode ne retourne pas de valeur.

VB

Cette méthode ne retourne pas de valeur.

Notes

Cette méthode est implémentée et accessible via la méthode Shell.EjectPC .

Exemples

Les exemples suivants montrent l’utilisation d’EjectPC dans JScript, VBScript et 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

Spécifications

Condition requise Valeur
Client minimal pris en charge
Windows 2000 Professionnel, Windows XP [applications de bureau uniquement]
Serveur minimal pris en charge
Windows 2000 Server [applications de bureau uniquement]
En-tête
Shldisp.h
IDL
Shldisp.idl
DLL
Shell32.dll (version 4.71 ou ultérieure)