newbie problem - file revision & size

  • Thread starter Thread starter Tcs
  • Start date Start date
T

Tcs

I have a bunch of machines on which I need to check .dll revisions. I'm trying
to write a simple(?) script to do this. here's what I have so far:

'---------------------------------------------------------------------------
strComputer = "."
Set objFSO = CreateObject("Scripting.FileSystemObject")

strNames = & _
"c:\winnt\regedit.exe," & _
"c:\winnt\explorer.exe"

arrNames = Split(strNames, ",")
Wscript.Echo Ubound(arrNames) + 1

Set objTextFile = objFSO.CreateTextFile("IT-DBAdmin_Jet_40_SP8_files.txt")

Do While NOT Ubound(arrNames) = ""

Wscript.Echo "(regedit.com)...(" & _
objFSO.GetFileVersion("c:\winnt\regedit.exe") & ")" & _
objFSO.FileSize("c:\winnt\regedit.exe") & ")"

Wscript.Echo "(explorer.exe)...(" & _
objFSO.GetFileVersion("c:\winnt\explorer.exe") & ")" & _
objFSO.FileSize("c:\winnt\explorer.exe") & ")"

Loop

objTextFile.Close
'---------------------------------------------------------------------------

And of course it doesn't work. I would *like* to set up an array of the
filenames I want info on, then cycle thru them until the list is finished. I'd
*also* like to write this info out to a file.

You can see that I have "pieces", just not the whole thing, plus my DO loop
isn't good. And my 'objFSO.FileSize' doesn't work as well. (Geez. But hey, I
only started with this wmi scripting about 2 hours ago... Really.) If i can't
cycle thru an array of the names I need, how would I set a path, so I cane save
some typing? (Since a lot of these are in the same place, such as
"C:\Winnt\system32".)

If anyone could "fill in the gaps", or point me to some where I might find what
I'm after, I'd appreciate it.

Thanks in advance,

Tom
 
In VBScript there is no FILESIZE method. In order to get the file size do
the following:

set f = objFSO.GetFile("c:\winnt\regedit.exe")
wscript.echo f.Name & " uses " & f.size & " bytes."
 
Back
Top