Re: WMIC - wrong file size values
From: AnyBody43 (anybody43_at_hotmail.com)
Date: 06/03/04
- Next message: AnyBody43: "Re: WMIC - wrong file size values"
- Previous message: Max Carper: "Why does WQL query "SELECT * FROM Win32_Directory WHERE Name = "C:\WINDOWS" fail?"
- In reply to: AnyBody43: "WMIC - wrong file size values"
- Next in thread: AnyBody43: "Re: WMIC - wrong file size values"
- Messages sorted by: [ date ] [ thread ]
Date: 3 Jun 2004 10:04:27 -0700
anybody43@hotmail.com (AnyBody43) wrote in message news:<3adc58e4.0406030132.6da12df2@posting.google.com>...
> Hi,
>
> WMIC /user:domain\administrator /password:xxxxxxxx
> /node:"10.0.0.1" DATAFILE WHERE
> Name="D:\\Program Files\\Exchsrvr\\mdbdata\\priv1.edb"
> GET FileSize
>
> Works on one server but returns completely the wrong values
> on another.
>
> The good one is Server 2003 with Exchange 2003
> The bad one is Server 2000 SP 4 with Exchange 2000 (I think)
> it is Ver 6.0 (build 6249.4: SP3)
> dir says Hex Hex wmic says
> priv1.edb 5,493,628,928 147722000 47721FFF 1198661631
> priv1.stm 6,970,941,440 19F802000 0 0
> pub1.edb 173,088,768 A512000 A512000 173088768
> pub1.stm 62,922,752 3C02000 3C02000 62922752
>
> 147722000
> 47721FFF
>
> Comparing the Hex values suggests that there is some size limit.
Update:
I have done a lot more on this and have the following.
Using WMI from VBScript has the same problem.
There is a thread in this newsgroup dated 22 Jan 2003 subject:
Re: Bug??? 2.1 GB CIM_DataFile FileSize limit
which discusses the issue also. It looks like there may be
a 2G (2^31 -1) limit, over which we get a failure in the
case of a Windows 2000 WMI server.
Another message that I found on the internet (from a microsoft
employee?) said that the variable was an unsigned 64 bit
value and so should support > 16 Giga Giga bytes. No, that is
not a stutter:) I have unfortunately lost the reference
for now.
I can not find anything on the MS website on it though.
So the only question now seems to be _Is there a fix
for Windows Server 2000?_
I have found it hard to get some code working (I am not a real
programmer) so here it is in case it helps someone else.
It was hard to find an example of CIM_DataFile with ConnectServer.
#########################################
Set StdOut = WScript.StdOut
strComputer = "xxx-server1"
strUser = "administrator@xxx.local"
' The domain\user form does not seem to recognise the domain
' It allows ANYTHING to be entered.
' The .local is optional.
strPassword = "zzzzzzzz"
strDomain = ""
' If this parameter is not NULL we get the error.
' SWbemLocator: Invalid parameter
set wmiLocator = CreateObject ("WbemScripting.SWbemLocator")
set wmiService = wmiLocator.ConnectServer _
(strComputer, "root\cimv2", _
strUser , strPassword, "", strDomain, 0, null )
Set objFile = wmiservice.ExecQuery _
("Select * From CIM_DataFile Where Name = 'c:\\boot.ini'")
For Each Thing in objFile
Wscript.Echo "Name: " & Thing.Name
Wscript.Echo "Size: " & Thing.Filesize
Next
#########################################
One last (less important) question in the event that anyone
reads this far down;)
In the code below there is an assignment to refFile.
Is there an equivalent construct for the ConnectServer
technique used above?
Set refFile = GetObject("winMgmts:CIM_DataFile.Name='c:\boot.ini'")
Wscript.echo "File name is: " & refFile.Name
Wscript.echo "File size is: " & refFile.FileSize & " bytes"
- Next message: AnyBody43: "Re: WMIC - wrong file size values"
- Previous message: Max Carper: "Why does WQL query "SELECT * FROM Win32_Directory WHERE Name = "C:\WINDOWS" fail?"
- In reply to: AnyBody43: "WMIC - wrong file size values"
- Next in thread: AnyBody43: "Re: WMIC - wrong file size values"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|