Re: newbie problem - file revision & size
- From: "Jonathan Liu [MSFT]" <jonliu@xxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 29 Aug 2005 13:03:04 -0700
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."
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Tcs" <TSmithATEastPointCityDOTorg> wrote in message
news:7umpg1ph5mbjsksgta398nqg9i68jh23tp@xxxxxxxxxx
>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
.
- References:
- newbie problem - file revision & size
- From: Tcs
- newbie problem - file revision & size
- Prev by Date: Re: WMI fail
- Next by Date: Re: Scheduling Jobs using WMI
- Previous by thread: newbie problem - file revision & size
- Next by thread: Re: missing process in wim32_process
- Index(es):
Relevant Pages
|