Ouverture pages web et exe + création raccourcis
Bonsoir à toutes et à tous,
Je souhaite en éxécutant un script vbs lancer 3 page web et un .exe (outlook), et créer un raccourci sur mon bureau après chaque lancement.
J'ai parcouru le forum et la FAQ VBScript, et me suis inspiré des différents codes que j'ai trouvé.
J'obtiens un message d'erreur que je n'arrive pas à résoudre (voir PJ).
Voici mon code :
Code:
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| MsgBox "Appuyer su OK pour lancer Ma_page_web"
Dim IE
Set IE = Wscript.CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.navigate "http://www.Ma_page_web.fr"
Dim Shell, DesktopPath, URL
Set Shell = CreateObject("WScript.Shell")
DesktopPath = Shell.SpecialFolders("Desktop")
Set URL = Shell.CreateShortcut(DesktopPath & "\Mon_page_web.URL")
URL.TargetPath = "http://www.ma_page_web.fr"
URL.Save
Wscript.Sleep 2000 ' durée en ms .. 2000 => 2 s
MsgBox "Appuyer su OK pour lancer Ma_page_web_1"
Dim IE
Set IE = Wscript.CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.navigate "http://www.Ma_page_web_1.fr"
Dim Shell, DesktopPath, URL
Set Shell = CreateObject("WScript.Shell")
DesktopPath = Shell.SpecialFolders("Desktop")
Set URL = Shell.CreateShortcut(DesktopPath & "\Mon_page_web_1.URL")
URL.TargetPath = "http://www.ma_page_web_1.fr"
URL.Save
Wscript.Sleep 2000 ' durée en ms .. 2000 => 2 s
MsgBox "Appuyer su OK pour lancer Ma_page_web_2"
Dim IE
Set IE = Wscript.CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.navigate "http://www.Ma_page_web_2.fr"
Dim Shell, DesktopPath, URL
Set Shell = CreateObject("WScript.Shell")
DesktopPath = Shell.SpecialFolders("Desktop")
Set URL = Shell.CreateShortcut(DesktopPath & "\Mon_page_web_2.URL")
URL.TargetPath = "http://www.ma_page_web_2.fr"
URL.Save
Wscript.Sleep 2000 ' durée en ms .. 2000 => 2 s
MsgBox "Appuyer sur OK pour lancer Outlook"
Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run("outlook.exe" , 1, true)
Dim Shell, DesktopPath, URL
Set Shell = CreateObject("WScript.Shell")
DesktopPath = Shell.SpecialFolders("Desktop")
Set URL = Shell.CreateShortcut(DesktopPath & "\monraccourci.lnk")
CreateObject("Scripting.FileSystemObject")
URL.IconLocation = "monicone.ico"
URL.TargetPath = "chemin\monexe.exe"
URL.Arguments = "-para monparametre"
URL.Save
SET oFS = nothing |
D'avance merci pour les réponses qui me parviendront.
Bien cordialement.