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 50 51 52 53 54 55 56 57 58 59 60
| Option Explicit
Dim WS, strDesktop, oMyShortCut,FSO,myShort
Dim I,Prg,Prg1, Msg,tb(3),lRet,RegVal,Creer
Const DestKey="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel\"
tb(1)="C:\Program Files\Microsoft Office\Winword.exe"
tb(2)="C:\Program Files\Microsoft Office\Excel.exe"
tb(3)="C:\Program Files\Microsoft Office\Outlook.exe"
set Fso=CreateObject("Scripting.FileSystemObject")
Set WS = WScript.CreateObject("WScript.Shell")
Msg="Souhaitez-vous afficher les éléments suivants sur le bureau ?" _
& vbcrlf & vbtab & Ucase("Poste de travail") _
& VbCrLf & vbtab & uCase("Mes Documents") _
& VbCrLf & vbtab & Ucase("Favoris Réseau") _
& VbCrLf & vbtab & Ucase("Internet Explorer") _
& VbCrLf & vbtab & Ucase("winword") _
& VbCrLf & vbtab & Ucase("Outlook") _
& VbCrLf & vbtab & Ucase("Excel")
lRet= MsgBox(Msg,VbYesNoCancel,"Raccourcis bureau")
If lRet=VbYes then
RegVal="0"
Creer=True
ElseIf lRet=VbNo Then
RegVal="1"
Creer=False
ElseIf lRet=VbCancel Then
Wscript.Quit
End If
WS.RegWrite DestKey & "{20D04FE0-3AEA-1069-A2D8-08002B30309D}",RegVal,"REG_DWORD" ' Poste de travail
WS.RegWrite DestKey & "{450D8FBA-AD25-11D0-98A8-0800361B1103}",RegVal,"REG_DWORD" ' Mes documents
WS.RegWrite DestKey & "{208D2C60-3AEA-1069-A2D7-08002B30309D}",RegVal,"REG_DWORD" ' Favoris Réseau
WS.RegWrite DestKey & "{871C5380-42A0-1069-A2EA-08002B30309D}",RegVal,"REG_DWORD" ' IE pour XP
WS.RegWrite DestKey & "{645FF040-5081-101B-9F08-00AA002F954E}",RegVal,"REG_DWORD" ' Corbeille
strDeskTop=WS.SpecialFolders("DeskTop")
For I=1 to 3
prg=tb(I) : Prg1=tb(I)
Prg1=Left(prg1,instrrev(prg1,"\"))
prg=Right(prg,len(prg)-instrrev(prg,"\"))
If Creer Then
Set oMyShortCut = WS.CreateShortcut(strDesktop & "\" & prg & ".lnk")
With oMyShortCut
.TargetPath = tb(I)
.Hotkey = "ALT+CTRL+" & Ucase(Left(prg,1))
.WorkingDirectory=Prg1
.WindowStyle = 1
.IconLocation= tb(i) & ",0"
.Save
End With
Else
set myShort=FSO.GetFile(strDesktop & "\" & prg & ".lnk")
myShort.Delete
End If
Next
ws.run "%Windir%\System32\rundll32.exe USER32.DLL,UpdatePerUserSystemParameters 0",1,1
Set WS=Nothing
Set FSO= Nothing
Wscript.Quit |