Bonjour,
J'essaie d'utiliser l'objet InternetExplorer.Application en mode utilisateur sans droit sur une page locale sur Windows 7. Est-ce possible ?
Voilà ce que je fais :
- je lance un script qui ouvre une page IE en local
- je fais un petit sleep
- je navigate vers une autre page en local
Sachant que en tant qu'utilisateur simple ET sur une page locale, ça plante après avoir chargé la première page. Comme ci je perdais le lien vers l'objet IE.application.... L'erreur exacte est : L'objet invoqué s'est déconnecté de ses clients.
Si je suis admin, si je donne des pages web quelconque ou si je suis sur Windows XP : pas de soucis.
Quelqu'un a une idée ?
Voici mes sources :
Fichier test.vbs
Fichier test.html
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 Set oIE=CreateObject("InternetExplorer.Application") Set fso=CreateObject("Scripting.filesystemObject") sourcepath = fso.GetParentFolderName(Wscript.ScriptFullName) OIE.left=0 ' window position OIE.top = 0 ' and other properties OIE.height = 600 OIE.width = 800 OIE.menubar = 0 ' no menu OIE.toolbar = 0 OIE.statusbar = 0 OIE.resizable = 0 ' disable resizing OIE.visible = 1 ' keep visible WScript.Sleep 2000 oIE.navigate sourcepath & "\test.html" 'oIE.navigate "http://www.google.com" WScript.Sleep 5000 OIE.visible = 1 oIE.navigate sourcepath & "\test2.html" 'oIE.navigate "http://www.clubic.com"
Fichier test2.html
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" > <head> <title>Bienvenue sur mon site !</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> COUCOU 1 </body> </html>
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" > <head> <title>Bienvenue sur mon site !</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> COUCOU 2 </body> </html>
Partager