Méthode IShellDispatch4. ExplorerPolicy
obtient la valeur d’une Windows de stratégie Internet Explorer spécifiée.
Syntaxe
retVal = IShellDispatch4.ExplorerPolicy(
bstrPolicyName
)
IShellDispatch4.ExplorerPolicy( _
ByVal bstrPolicyName As BSTR _
) As Variant
Paramètres
-
bstrPolicyName [ dans]
-
Type : BSTR
Chaîne qui spécifie le nom de la stratégie.
Valeur de retour
JScript
Type : variante *
Valeur associée au nom de stratégie spécifié.
VB
Type : variante *
Valeur associée au nom de stratégie spécifié.
Notes
Les administrateurs réseau peuvent contrôler et gérer l’environnement informatique de leurs utilisateurs en définissant des stratégies.
le nom de la valeur spécifiée doit se trouver dans la sous-clé HKEY _ CURRENT _ USER \ Software \ Microsoft \ Windows \ CurrentVersion \ policies \ Explorer . Si le nom de la valeur n’existe pas, la méthode retourne la valeur null.
Exemples
les exemples suivants illustrent l’utilisation correcte de ExplorerPolicy pour JScript, VBScript et Visual Basic.
JScript :
<script language="JScript">
function fnIShellDispatch4ExplorerPolicyJ()
{
var objShell = new ActiveXObject("shell.application");
var vReturn;
vReturn = objshell.ExplorerPolicy("ValueName");
alert(vReturn);
}
</script>
VBScript
<script language="VBScript">
function fnIShellDispatch4ExplorerPolicyVB()
dim objShell
dim vReturn
set objShell = CreateObject("shell.application")
vReturn = objshell.ExplorerPolicy("ValueName")
alert(vReturn)
set objShell = nothing
end function
</script>
Visual Basic :
Private Sub fnIShellDispatch4ExplorerPolicyVB()
Dim objShell As Shell
Dim vReturn As Variant
Set objShell = New Shell
vReturn = objshell.ExplorerPolicy("ValueName")
Debug.Print vReturn
Set objShell = Nothing
End Sub
Spécifications
| Condition requise | Valeur |
|---|---|
| Client minimal pris en charge |
Windows [Applications de bureau XP uniquement] |
| Serveur minimal pris en charge |
Windows Serveur 2003 [ applications de bureau uniquement] |
| En-tête |
|
| MIDL |
|
| DLL |
|