Question

Locked

script to list program versions

By mmentele ·
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 conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Your code seems to be missing..

by Slayer_ In reply to script to list program ve ...

The part of the FSO object that tells it to actually writes its buffer to the fole, you also need to close the file.
I rarely use FSO so I am not entirely sure of the command. I asume you are writing this in VBS?


Also I could be wrong but I think you can do this easily in a DOS batch file.

Enter a command

dir C:\*.exe /S > C:\Output.txt

This will output Date/time and filename and size to a file called output.txt on the root of your drive.

Back to Hardware Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums