Bonjour à tous,

Voilà mon soucis, j'ai trouvé un script sur le Net qui correspond parfaitement à ce que je veux faire, mais lorsque je le lance, il m'affiche cette erreur : Permission refusée

Merci d'avance à tous pour votre aide


Voici le script :

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
Option Explicit 'force all variables to be declared
Const ForWriting = 2
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
 
Dim objTS 'Text Stream Object
Set objTS = objFSO.OpenTextFile("C:\Output.txt", ForWriting, True)
 
Recurse objFSO.GetFolder("C:\")
objTS.Close()
 
Sub Recurse(objFolder)
    Dim objFile, objSubFolder
 
    For Each objFile In objFolder.Files
        If LCase(objFSO.GetExtensionName(objFile.Name)) = "locky" Then
            objTS.WriteLine(objfile.Path)
        End If
    Next
 
    For Each objSubFolder In objFolder.SubFolders
        Recurse objSubFolder
    Next
End Sub