Je viens de créer ce script qui fonctionne pour moi et qui le liste le contenu du dossier C:\Program Files\OCS Inventory Agent\Plugins
Option Explicit
Const STR_ROOT_FOLDER_PATH = "C:\Program Files\OCS Inventory Agent\Plugins"
Const INT_MAX_LEVELS = 3
Dim objOutputFile, objShell, objFso, timeStart, objFolder
Set objFso = CreateObject("Scripting.FileSystemObject")
If NOT objFso.FolderExists(STR_ROOT_FOLDER_PATH) Then Wscript.Quit 100
Set objFolder = objFso.GetFolder(STR_ROOT_FOLDER_PATH)
'Set objOutputFile = objFso.CreateTextFile(STR_OUTPUT_TXT_FILE,True)
BrowseFolder objFolder, 0, INT_MAX_LEVELS, False
Sub BrowseFolder(objRootFolder, intCurrenLevel, intLevelMax, boolLastFolder)
Dim objFso, colSubFolders, objFile, objSubFolder, colFiles, intNbItems, intLastItem, boolLastItem
On Error Resume Next
Set colSubFolders = objRootFolder.subFolders
Set colFiles = objRootFolder.Files
intNbItems = 0
intLastItem = colSubFolders.Count
boolLastItem = False
For Each objSubFolder in colSubFolders
intNbItems = intNbItems + 1
If intNbItems = intLastItem Then boolLastItem = True
If intCurrenLevel <= intLevelMax Then BrowseFolder objSubFolder, intCurrenLevel + 1, intLevelMax, boolLastItem
Next
intNbItems = 0
intLastItem = colFiles.Count
boolLastItem = False
For Each objFile in colFiles
intNbItems = intNbItems + 1
If intNbItems = intLastItem Then boolLastItem = True
WScript.Echo "<SOFTWARES>"
WScript.Echo "<PUBLISHER>Bimedia Plugin</PUBLISHER>"
WScript.Echo "<NAME>" & objFile.Name & "</NAME>"
WScript.Echo "<VERSION>" & objFile.Version & "</VERSION>"
WScript.Echo "<FOLDER>" & objFile.ParentFolder & "</FOLDER>"
WScript.Echo "<FILENAME>" & objFile.FileName & "</FILENAME>"
WScript.Echo "<FILESIZE>" & objFile.FileSize & "</FILESIZE>"
WScript.Echo "<INSTALLDATE>" & objFile.CreationDate & "</INSTALLDATE>"
Wscript.Echo "<COMMENTS>Plugin OCS</COMMENTS>"
WScript.Echo "</SOFTWARES>"
Next
End Sub
Function RepeatString (strInputString, intNbIteration)
Dim i
RepeatString = ""
i = 0
Do While i < intNbIteration
RepeatString = RepeatString & strInputString
i = i + 1
Loop
End Function
Function IncrementTree (intNbIteration, boolLastItem)
Dim strEol
IncrementTree = ""
If intNbIteration = 0 Then Exit Function
strEol = "|-- "
If boolLastItem = True Then strEol = "`-- "
IncrementTree = RepeatString("| ", intNbIteration - 1) & strEol
End Function
Voila à toi de l'adapter en fonction de tes besoins. Les fichiers remontent dans la section software de OCS.