ceci me renvoi une erreur à la ligne 18:
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
28
29
30 set WshShell = WScript.CreateObject("WScript.Shell") DesktopPath = WSHShell.SpecialFolders("Desktop") Set oFSO = CreateObject("Scripting.FileSystemObject") stRep = DesktopPath If oFSO.FolderExists(stRep) Then For each oFl in oFSO.GetFolder(stRep).Files if LCase(oFso.GetExtensionName(oFl)) = "lnk" then vrChmRccrc = replace(oFl.Path,"\","\\") 'msgbox vrChmRccrc strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ShortcutFile WHERE Name = '" & vrChmRccrc & "'",,48) wscript.echo colItems.count For Each objItem in colItems If not oFSO.FileExists(objItem.Target) Then Set fsoFile = ofso.getFile(oFl.Path) fsoFile.delete End If Wscript.Echo "Cible: " & objItem.Target Next End If Next End If
Partager