script to list program versions - TechRepublic
Question
February 13, 2009 at 07:56 AM
mmentele

script to list program versions

by mmentele . Updated 17 years, 4 months ago

Hello I am trying to produce a script that outputs all the file verion and date info for a filetype in a mapped drive on a shared directiory. The script I have works locally but fails on the mapped drive

here it is any hints?

Option Explicit
Dim fso, fc, f, fs
Dim strPath, strFile

‘On Error Resume Next

strPath = “C:\Documents and Settings\profilename\desktop\exes.txt”

Set fso = CreateObject(“Scripting.FileSystemObject”)

Set strFile = fso.CreateTextFile(strPath, True)

strFile.WriteLine(“FileName,Last Modified,File Version”)

Set f = fso.GetFolder(“D:\Program Files\winLAME”)
Set fc = f.Files
For Each fs In fc
If fso.GetExtensionName(fs) = “exe” then
strFile.WriteLine(fs.Name & “,” & fs.DateLastModified & “,” & fso.GetFileVersion(fs))
End if
Next

This discussion is locked

All Comments