Exemple de script pour epingler un raccourci dans le menu demarrer
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 |
Const CSIDL_COMMON_PROGRAMS = &H17 Const CSIDL_PROGRAMS = &H2 Set FSO = CreateObject("Scripting.FileSystemObject") Set Shell = CreateObject("WScript.Shell") Dim Destination Destination = Shell.ExpandEnvironmentStrings(("%APPDATA%") & "\Microsoft" & "\Internet Explorer" & "\Quick Launch" & "\User Pinned" & "\StartMenu" & "\Mozilla Firefox.lnk") If FSO.FileExists(Destination) = True Then FSO.DeleteFile Destination Else on error resume next End If Set objShell = CreateObject("Shell.Application") Set objAllUsersProgramsFolder = objShell.NameSpace("C:\ProgramData\Microsoft\Windows\Start Menu") strAllUsersProgramsPath = objAllUsersProgramsFolder.Self.Path 'msgbox strAllUsersProgramsPath Set objFolder = objShell.Namespace(strAllUsersProgramsPath) Set objFolderItem = objFolder.ParseName("Mozilla Firefox.lnk") Set colVerbs = objFolderItem.Verbs For Each objVerb in colVerbs 'wscript.Echo objVerb.name If Instr(UCase(objVerb.name),"MENU") <> 0 And Instr(UCase(objVerb.name),"MARRER") <> 0 Then objVerb.DoIt End If Next |
Cet article n'a pas été revu depuis la publication.
Cet article a été créé par david le 26 décembre 2016.
Laisser un commentaire