Re: WMIC - wrong file size values

From: AnyBody43 (anybody43_at_hotmail.com)
Date: 06/03/04


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"



Relevant Pages

  • Re: Error message when sending E-mail: Disc Space Exceeded.
    ... send yourself a single .jpg image, and check the filesize of the email when ... powerpoint slideshow occupies much more than its filesize when encoded to be ... put the large file on a web server and send the receiver a link to that. ... when attempting to send a PowerPoint slideshow. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • alerting on filesize on win2K Terminal Server
    ... I was wondering if there was any sort of alerting tools for a terminal ... Specifically to do with users' filesize. ... I have a Win 2000 Terminal Server, ...
    (microsoft.public.win2000.termserv.clients)
  • Re: FTP Programming Question
    ... completely uploaded to the server. ... it seems that the filesize before it hits the FTP server is not equal ... you are using binary mode. ...
    (microsoft.public.dotnet.framework)
  • FTP Programming Question
    ... I have an FTP programming question. ... completely uploaded to the server. ... it seems that the filesize before it hits the FTP server is not equal ... Public Function GetFileSize(ByVal sFileName As String) As Long ...
    (microsoft.public.dotnet.framework)
  • Re: connectserver, default, cimv2
    ... > I am connecting to the server using the connect server and to need to ... ConnectServer call doesn't support any mechanism that I can see to change ... the first to ConenctServer (with no namespace) is probably ...
    (microsoft.public.scripting.vbscript)