I tried using Shell and NameSpace to lookup file version numbers over a
share as in

\\abc\c$\installs but it fails to return the same info as c:\installs for
example

==========runme.vbs============
function GetFileVersion(ThisFolder, FileName)
dim objShell : set objShell = CreateObject("Shell.Application")
dim objFolder : set objFolder = objShell.NameSpace(ThisFolder)
dim objItem : set objItem = objFolder.ParseName(FileName)
GetFileVersion = ""
for i = -1 to 34
GetFileVersion = GetFileVersion & objFolder.GetDetailsOf(objItem,i)
& vbcrlf
next
end function

' assume that c:\temp contains notepad.exe and xxxxx is the computer name
' the following two lines of code return different information.
' in particular the i = -1 "File Version:" is missing on the share C$\temp
WScript.Echo GetFileVersion ("c:\temp", "notepad.exe")
WScript.Echo GetFileVersion ("\\xxxxx\c$\temp", "notepad.exe")
========================

Is there any other way to get file version info on .exe, .ocx, .dll ?


--
=======================================================================
Beemer Biker joestateson@grandecom.net
http://TipsForTheComputingImpaired.com
http://ResearchRiders.org Ask about my 99'R1100RT
=======================================================================

RE: how to get file version info thru a share? by Chuck

Chuck
Wed Jan 25 10:13:04 CST 2006

You can use FileSystemObject:

Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject")
WScript.Echo oFSO.GetFileVersion("c:\temp\notepad.exe")
WScript.Echo oFSO.GetFileVersion("\\xxxxxx\c$\temp\notepad.exe")




"Beemer Biker" wrote:

> I tried using Shell and NameSpace to lookup file version numbers over a
> share as in
>
> \\abc\c$\installs but it fails to return the same info as c:\installs for
> example
>
> ==========runme.vbs============
> function GetFileVersion(ThisFolder, FileName)
> dim objShell : set objShell = CreateObject("Shell.Application")
> dim objFolder : set objFolder = objShell.NameSpace(ThisFolder)
> dim objItem : set objItem = objFolder.ParseName(FileName)
> GetFileVersion = ""
> for i = -1 to 34
> GetFileVersion = GetFileVersion & objFolder.GetDetailsOf(objItem,i)
> & vbcrlf
> next
> end function
>
> ' assume that c:\temp contains notepad.exe and xxxxx is the computer name
> ' the following two lines of code return different information.
> ' in particular the i = -1 "File Version:" is missing on the share C$\temp
> WScript.Echo GetFileVersion ("c:\temp", "notepad.exe")
> WScript.Echo GetFileVersion ("\\xxxxx\c$\temp", "notepad.exe")
> ========================
>
> Is there any other way to get file version info on .exe, .ocx, .dll ?
>
>
> --
> =======================================================================
> Beemer Biker joestateson@grandecom.net
> http://TipsForTheComputingImpaired.com
> http://ResearchRiders.org Ask about my 99'R1100RT
> =======================================================================
>
>
>

Re: how to get file version info thru a share? by Beemer

Beemer
Wed Jan 25 14:06:33 CST 2006

"Chuck" <Chuck@discussions.microsoft.com> wrote in message
news:7DA0A284-936C-4F50-AF62-6A155A46BFC2@microsoft.com...
> You can use FileSystemObject:
>
> Dim oFSO : Set oFSO = CreateObject("Scripting.FileSystemObject")
> WScript.Echo oFSO.GetFileVersion("c:\temp\notepad.exe")
> WScript.Echo oFSO.GetFileVersion("\\xxxxxx\c$\temp\notepad.exe")
>

Thanks, that did it. I overlooked the obvious and tried to do it the hard
way.