total size of files

I need a script to find out the number & total size of files based
upon the file extention across about 30 servers. I'm searching for mdb
files. The script will be run remotely against local drives on these
servers. Thanks
0
Tom1
11/18/2009 3:19:59 PM
scripting.vbscript 564 articles. 0 followers. Follow

16 Replies
1615 Views

Similar Articles

[PageSpeed] 6

On Nov 18, 10:19=A0am, Tom1 <usernetu...@yahoo.com> wrote:
> I need a script to find out the number & total size of files based
> upon the file extention across about 30 servers. I'm searching for mdb
> files. The script will be run remotely against local drives on these
> servers. Thanks

<warning>
<aircode>

with createobject("scripting.filesystemobject")
  aComputers =3D split(.opentextfile("D:\Someplace\complist.txt", _
                1).readall, vbnewline)
end with

nComputers =3D UBound(aComputers)
Redim aData(nComputers)

for i =3D 0 to nComputers
  nSize =3D 0
  nCount =3D 0
  Set objWMIService =3D GetObject("winmgmts:" _
    & "{impersonationLevel=3Dimpersonate}!\\" & _
        aComputers(i) & "\root\cimv2")
  Set colFiles =3D objWMIService.ExecQuery _
    ("Select * from CIM_DataFile where Extension =3D 'mdb'", , 48)
  For Each objFile in colFiles
    nSize =3D nSize + objFile.size
  Next
  nCount =3D nCount + colFiles.count
  aData(i) =3D Join(Array(aComputers(i), nCount, nSize), ", ")
Next

wsh.echo Join(aData, vbnewline)

</aircode>
</warning>

Another warning:  CIM_DataFile searches are SLOW.  Be prepared to W -
A - I - T.
_____________________
Tom Lavedas
0
Tom
11/18/2009 3:43:09 PM
On Nov 18, 10:43=A0am, Tom Lavedas <tglba...@cox.net> wrote:
> On Nov 18, 10:19=A0am, Tom1 <usernetu...@yahoo.com> wrote:
>
> > I need a script to find out the number & total size of files based
> > upon the file extention across about 30 servers. I'm searching for mdb
> > files. The script will be run remotely against local drives on these
> > servers. Thanks
>
> <warning>
> <aircode>
>
> with createobject("scripting.filesystemobject")
> =A0 aComputers =3D split(.opentextfile("D:\Someplace\complist.txt", _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 1).readall, vbnewline)
> end with
>
> nComputers =3D UBound(aComputers)
> Redim aData(nComputers)
>
> for i =3D 0 to nComputers
> =A0 nSize =3D 0
> =A0 nCount =3D 0
> =A0 Set objWMIService =3D GetObject("winmgmts:" _
> =A0 =A0 & "{impersonationLevel=3Dimpersonate}!\\" & _
> =A0 =A0 =A0 =A0 aComputers(i) & "\root\cimv2")
> =A0 Set colFiles =3D objWMIService.ExecQuery _
> =A0 =A0 ("Select * from CIM_DataFile where Extension =3D 'mdb'", , 48)
> =A0 For Each objFile in colFiles
> =A0 =A0 nSize =3D nSize + objFile.size
> =A0 Next
> =A0 nCount =3D nCount + colFiles.count
> =A0 aData(i) =3D Join(Array(aComputers(i), nCount, nSize), ", ")
> Next
>
> wsh.echo Join(aData, vbnewline)
>
> </aircode>
> </warning>
>
> Another warning: =A0CIM_DataFile searches are SLOW. =A0Be prepared to W -
> A - I - T.
> _____________________
> Tom Lavedas

Thanks but I get the following error message:

test.vbs(22, 5) Microsoft VBScript runtime error: Object doesn't
support this property or method: 'size'
0
Tom1
11/18/2009 4:40:16 PM
On Nov 18, 11:40=A0am, Tom1 <usernetu...@yahoo.com> wrote:
> On Nov 18, 10:43=A0am, Tom Lavedas <tglba...@cox.net> wrote:
>
>
>
> > On Nov 18, 10:19=A0am, Tom1 <usernetu...@yahoo.com> wrote:
>
> > > I need a script to find out the number & total size of files based
> > > upon the file extention across about 30 servers. I'm searching for md=
b
> > > files. The script will be run remotely against local drives on these
> > > servers. Thanks
>
> > <warning>
> > <aircode>
>
> > with createobject("scripting.filesystemobject")
> > =A0 aComputers =3D split(.opentextfile("D:\Someplace\complist.txt", _
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 1).readall, vbnewline)
> > end with
>
> > nComputers =3D UBound(aComputers)
> > Redim aData(nComputers)
>
> > for i =3D 0 to nComputers
> > =A0 nSize =3D 0
> > =A0 nCount =3D 0
> > =A0 Set objWMIService =3D GetObject("winmgmts:" _
> > =A0 =A0 & "{impersonationLevel=3Dimpersonate}!\\" & _
> > =A0 =A0 =A0 =A0 aComputers(i) & "\root\cimv2")
> > =A0 Set colFiles =3D objWMIService.ExecQuery _
> > =A0 =A0 ("Select * from CIM_DataFile where Extension =3D 'mdb'", , 48)
> > =A0 For Each objFile in colFiles
> > =A0 =A0 nSize =3D nSize + objFile.size
> > =A0 Next
> > =A0 nCount =3D nCount + colFiles.count
> > =A0 aData(i) =3D Join(Array(aComputers(i), nCount, nSize), ", ")
> > Next
>
> > wsh.echo Join(aData, vbnewline)
>
> > </aircode>
> > </warning>
>
> > Another warning: =A0CIM_DataFile searches are SLOW. =A0Be prepared to W=
 -
> > A - I - T.
> > _____________________
> > Tom Lavedas
>
> Thanks but I get the following error message:
>
> test.vbs(22, 5) Microsoft VBScript runtime error: Object doesn't
> support this property or method: 'size'

I was afraid of that - I keep forgetting what the differences are
between Shell.Application and FSO.  OK, try this mod ...

set fso =3D  createobject("scripting.filesystemobject")
with fso
  aComputers =3D split(.opentextfile("D:\Someplace\complist.txt", _
                1).readall, vbnewline)
end with

nComputers =3D UBound(aComputers)
Redim aData(nComputers)

for i =3D 0 to nComputers
  nSize =3D 0
  nCount =3D 0
  Set objWMIService =3D GetObject("winmgmts:" _
    & "{impersonationLevel=3Dimpersonate}!\\" & _
        aComputers(i) & "\root\cimv2")
  Set colFiles =3D objWMIService.ExecQuery _
    ("Select * from CIM_DataFile where Extension =3D 'mdb'", , 48)
  For Each objFile in colFiles
    nSize =3D nSize + fso.GetFile(objFile.Path).size
  Next
  nCount =3D nCount + colFiles.count
  aData(i) =3D Join(Array(aComputers(i), nCount, nSize), ", ")
Next

wsh.echo Join(aData, vbnewline)
_____________________
Tom Lavedas
0
Tom
11/18/2009 4:58:39 PM
"Tom1" <usernetuser@yahoo.com> wrote in message 
news:b56abc7b-efa0-449f-9d42-dfcd054e3ccd@k4g2000yqb.googlegroups.com...
>I need a script to find out the number & total size of files based
> upon the file extention across about 30 servers. I'm searching for mdb
> files. The script will be run remotely against local drives on these
> servers. Thanks

In view of Tom's explicit warning about the slowness of the WMI solution, 
what's wrong with the humble "dir" command? It can access remote resources 
and it is *much* faster than WMI. 


0
Pegasus
11/18/2009 4:59:48 PM
On Nov 18, 11:58=A0am, Tom Lavedas <tglba...@cox.net> wrote:
> On Nov 18, 11:40=A0am, Tom1 <usernetu...@yahoo.com> wrote:
>
>
>
> > On Nov 18, 10:43=A0am, Tom Lavedas <tglba...@cox.net> wrote:
>
> > > On Nov 18, 10:19=A0am, Tom1 <usernetu...@yahoo.com> wrote:
>
> > > > I need a script to find out the number & total size of files based
> > > > upon the file extention across about 30 servers. I'm searching for =
mdb
> > > > files. The script will be run remotely against local drives on thes=
e
> > > > servers. Thanks
>
> > > <warning>
> > > <aircode>
>
> > > with createobject("scripting.filesystemobject")
> > > =A0 aComputers =3D split(.opentextfile("D:\Someplace\complist.txt", _
> > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 1).readall, vbnewline)
> > > end with
>
> > > nComputers =3D UBound(aComputers)
> > > Redim aData(nComputers)
>
> > > for i =3D 0 to nComputers
> > > =A0 nSize =3D 0
> > > =A0 nCount =3D 0
> > > =A0 Set objWMIService =3D GetObject("winmgmts:" _
> > > =A0 =A0 & "{impersonationLevel=3Dimpersonate}!\\" & _
> > > =A0 =A0 =A0 =A0 aComputers(i) & "\root\cimv2")
> > > =A0 Set colFiles =3D objWMIService.ExecQuery _
> > > =A0 =A0 ("Select * from CIM_DataFile where Extension =3D 'mdb'", , 48=
)
> > > =A0 For Each objFile in colFiles
> > > =A0 =A0 nSize =3D nSize + objFile.size
> > > =A0 Next
> > > =A0 nCount =3D nCount + colFiles.count
> > > =A0 aData(i) =3D Join(Array(aComputers(i), nCount, nSize), ", ")
> > > Next
>
> > > wsh.echo Join(aData, vbnewline)
>
> > > </aircode>
> > > </warning>
>
> > > Another warning: =A0CIM_DataFile searches are SLOW. =A0Be prepared to=
 W -
> > > A - I - T.
> > > _____________________
> > > Tom Lavedas
>
> > Thanks but I get the following error message:
>
> > test.vbs(22, 5) Microsoft VBScript runtime error: Object doesn't
> > support this property or method: 'size'
>
> I was afraid of that - I keep forgetting what the differences are
> between Shell.Application and FSO. =A0OK, try this mod ...
>
> set fso =3D =A0createobject("scripting.filesystemobject")
> with fso
> =A0 aComputers =3D split(.opentextfile("D:\Someplace\complist.txt", _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 1).readall, vbnewline)
> end with
>
> nComputers =3D UBound(aComputers)
> Redim aData(nComputers)
>
> for i =3D 0 to nComputers
> =A0 nSize =3D 0
> =A0 nCount =3D 0
> =A0 Set objWMIService =3D GetObject("winmgmts:" _
> =A0 =A0 & "{impersonationLevel=3Dimpersonate}!\\" & _
> =A0 =A0 =A0 =A0 aComputers(i) & "\root\cimv2")
> =A0 Set colFiles =3D objWMIService.ExecQuery _
> =A0 =A0 ("Select * from CIM_DataFile where Extension =3D 'mdb'", , 48)
> =A0 For Each objFile in colFiles
> =A0 =A0 nSize =3D nSize + fso.GetFile(objFile.Path).size
> =A0 Next
> =A0 nCount =3D nCount + colFiles.count
> =A0 aData(i) =3D Join(Array(aComputers(i), nCount, nSize), ", ")
> Next
>
> wsh.echo Join(aData, vbnewline)
> _____________________
> Tom Lavedas

Oops, wrong property.  Change objFile.Path to objFile.Name.

I told you I keep getting the differences confused.

And, unless the administrative shares have been removed (C$, D$,
etc.), Pegusus' approach is at least as good, if not better ...

  dir \\computername\C$\*.mdb /s | find " File(s) "

I keep forgetting about the administrative share!  (and this is a VBS
group ;-)
_____________________
Tom Lavedas
0
Tom
11/18/2009 5:13:30 PM
On Nov 18, 11:58=A0am, Tom Lavedas <tglba...@cox.net> wrote:
> On Nov 18, 11:40=A0am, Tom1 <usernetu...@yahoo.com> wrote:
>
>
>
>
>
> > On Nov 18, 10:43=A0am, Tom Lavedas <tglba...@cox.net> wrote:
>
> > > On Nov 18, 10:19=A0am, Tom1 <usernetu...@yahoo.com> wrote:
>
> > > > I need a script to find out the number & total size of files based
> > > > upon the file extention across about 30 servers. I'm searching for =
mdb
> > > > files. The script will be run remotely against local drives on thes=
e
> > > > servers. Thanks
>
> > > <warning>
> > > <aircode>
>
> > > with createobject("scripting.filesystemobject")
> > > =A0 aComputers =3D split(.opentextfile("D:\Someplace\complist.txt", _
> > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 1).readall, vbnewline)
> > > end with
>
> > > nComputers =3D UBound(aComputers)
> > > Redim aData(nComputers)
>
> > > for i =3D 0 to nComputers
> > > =A0 nSize =3D 0
> > > =A0 nCount =3D 0
> > > =A0 Set objWMIService =3D GetObject("winmgmts:" _
> > > =A0 =A0 & "{impersonationLevel=3Dimpersonate}!\\" & _
> > > =A0 =A0 =A0 =A0 aComputers(i) & "\root\cimv2")
> > > =A0 Set colFiles =3D objWMIService.ExecQuery _
> > > =A0 =A0 ("Select * from CIM_DataFile where Extension =3D 'mdb'", , 48=
)
> > > =A0 For Each objFile in colFiles
> > > =A0 =A0 nSize =3D nSize + objFile.size
> > > =A0 Next
> > > =A0 nCount =3D nCount + colFiles.count
> > > =A0 aData(i) =3D Join(Array(aComputers(i), nCount, nSize), ", ")
> > > Next
>
> > > wsh.echo Join(aData, vbnewline)
>
> > > </aircode>
> > > </warning>
>
> > > Another warning: =A0CIM_DataFile searches are SLOW. =A0Be prepared to=
 W -
> > > A - I - T.
> > > _____________________
> > > Tom Lavedas
>
> > Thanks but I get the following error message:
>
> > test.vbs(22, 5) Microsoft VBScript runtime error: Object doesn't
> > support this property or method: 'size'
>
> I was afraid of that - I keep forgetting what the differences are
> between Shell.Application and FSO. =A0OK, try this mod ...
>
> set fso =3D =A0createobject("scripting.filesystemobject")
> with fso
> =A0 aComputers =3D split(.opentextfile("D:\Someplace\complist.txt", _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 1).readall, vbnewline)
> end with
>
> nComputers =3D UBound(aComputers)
> Redim aData(nComputers)
>
> for i =3D 0 to nComputers
> =A0 nSize =3D 0
> =A0 nCount =3D 0
> =A0 Set objWMIService =3D GetObject("winmgmts:" _
> =A0 =A0 & "{impersonationLevel=3Dimpersonate}!\\" & _
> =A0 =A0 =A0 =A0 aComputers(i) & "\root\cimv2")
> =A0 Set colFiles =3D objWMIService.ExecQuery _
> =A0 =A0 ("Select * from CIM_DataFile where Extension =3D 'mdb'", , 48)
> =A0 For Each objFile in colFiles
> =A0 =A0 nSize =3D nSize + fso.GetFile(objFile.Path).size
> =A0 Next
> =A0 nCount =3D nCount + colFiles.count
> =A0 aData(i) =3D Join(Array(aComputers(i), nCount, nSize), ", ")
> Next
>
> wsh.echo Join(aData, vbnewline)
> _____________________
> Tom Lavedas- Hide quoted text -
>
> - Show quoted text -

Still not working -- test.vbs(24, 5) Microsoft VBScript runtime error:
File not found
0
Tom1
11/18/2009 5:14:17 PM
On Nov 18, 12:13=A0pm, Tom Lavedas <tglba...@cox.net> wrote:
> On Nov 18, 11:58=A0am, Tom Lavedas <tglba...@cox.net> wrote:
>
>
>
>
>
> > On Nov 18, 11:40=A0am, Tom1 <usernetu...@yahoo.com> wrote:
>
> > > On Nov 18, 10:43=A0am, Tom Lavedas <tglba...@cox.net> wrote:
>
> > > > On Nov 18, 10:19=A0am, Tom1 <usernetu...@yahoo.com> wrote:
>
> > > > > I need a script to find out the number & total size of files base=
d
> > > > > upon the file extention across about 30 servers. I'm searching fo=
r mdb
> > > > > files. The script will be run remotely against local drives on th=
ese
> > > > > servers. Thanks
>
> > > > <warning>
> > > > <aircode>
>
> > > > with createobject("scripting.filesystemobject")
> > > > =A0 aComputers =3D split(.opentextfile("D:\Someplace\complist.txt",=
 _
> > > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 1).readall, vbnewline)
> > > > end with
>
> > > > nComputers =3D UBound(aComputers)
> > > > Redim aData(nComputers)
>
> > > > for i =3D 0 to nComputers
> > > > =A0 nSize =3D 0
> > > > =A0 nCount =3D 0
> > > > =A0 Set objWMIService =3D GetObject("winmgmts:" _
> > > > =A0 =A0 & "{impersonationLevel=3Dimpersonate}!\\" & _
> > > > =A0 =A0 =A0 =A0 aComputers(i) & "\root\cimv2")
> > > > =A0 Set colFiles =3D objWMIService.ExecQuery _
> > > > =A0 =A0 ("Select * from CIM_DataFile where Extension =3D 'mdb'", , =
48)
> > > > =A0 For Each objFile in colFiles
> > > > =A0 =A0 nSize =3D nSize + objFile.size
> > > > =A0 Next
> > > > =A0 nCount =3D nCount + colFiles.count
> > > > =A0 aData(i) =3D Join(Array(aComputers(i), nCount, nSize), ", ")
> > > > Next
>
> > > > wsh.echo Join(aData, vbnewline)
>
> > > > </aircode>
> > > > </warning>
>
> > > > Another warning: =A0CIM_DataFile searches are SLOW. =A0Be prepared =
to W -
> > > > A - I - T.
> > > > _____________________
> > > > Tom Lavedas
>
> > > Thanks but I get the following error message:
>
> > > test.vbs(22, 5) Microsoft VBScript runtime error: Object doesn't
> > > support this property or method: 'size'
>
> > I was afraid of that - I keep forgetting what the differences are
> > between Shell.Application and FSO. =A0OK, try this mod ...
>
> > set fso =3D =A0createobject("scripting.filesystemobject")
> > with fso
> > =A0 aComputers =3D split(.opentextfile("D:\Someplace\complist.txt", _
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 1).readall, vbnewline)
> > end with
>
> > nComputers =3D UBound(aComputers)
> > Redim aData(nComputers)
>
> > for i =3D 0 to nComputers
> > =A0 nSize =3D 0
> > =A0 nCount =3D 0
> > =A0 Set objWMIService =3D GetObject("winmgmts:" _
> > =A0 =A0 & "{impersonationLevel=3Dimpersonate}!\\" & _
> > =A0 =A0 =A0 =A0 aComputers(i) & "\root\cimv2")
> > =A0 Set colFiles =3D objWMIService.ExecQuery _
> > =A0 =A0 ("Select * from CIM_DataFile where Extension =3D 'mdb'", , 48)
> > =A0 For Each objFile in colFiles
> > =A0 =A0 nSize =3D nSize + fso.GetFile(objFile.Path).size
> > =A0 Next
> > =A0 nCount =3D nCount + colFiles.count
> > =A0 aData(i) =3D Join(Array(aComputers(i), nCount, nSize), ", ")
> > Next
>
> > wsh.echo Join(aData, vbnewline)
> > _____________________
> > Tom Lavedas
>
> Oops, wrong property. =A0Change objFile.Path to objFile.Name.
>
> I told you I keep getting the differences confused.
>
> And, unless the administrative shares have been removed (C$, D$,
> etc.), Pegusus' approach is at least as good, if not better ...
>
> =A0 dir \\computername\C$\*.mdb /s | find " File(s) "
>
> I keep forgetting about the administrative share! =A0(and this is a VBS
> group ;-)
> _____________________
> Tom Lavedas- Hide quoted text -
>
> - Show quoted text -

Thanks Tom

Is there a way to get just the total count & size? I just ran the
following command:

dir \\server1\h$:\*.ppt /s | find " File(s) "

          19 File(s)     49,850,383 bytes
           2 File(s)     14,699,520 bytes
          13 File(s)     20,429,824 bytes
           3 File(s)      8,284,672 bytes
           6 File(s)      9,275,392 bytes
           1 File(s)      2,814,464 bytes
           6 File(s)     28,538,880 bytes
           2 File(s)      9,221,632 bytes
           9 File(s)     16,318,976 bytes
           7 File(s)     11,241,472 bytes
          10 File(s)     46,939,648 bytes
           2 File(s)      6,682,112 bytes
           2 File(s)     12,724,224 bytes
          14 File(s)     30,193,152 bytes
           1 File(s)      5,980,160 bytes
           1 File(s)      1,647,104 bytes
           5 File(s)     29,892,096 bytes
           1 File(s)      2,814,464 bytes
           4 File(s)     13,792,256 bytes
           1 File(s)      3,254,784 bytes
         109 File(s)    324,595,215 bytes

As you can see, all I need is the 109 files & the 324,595,215 bytes in
the output (not interested in the numbers before that). Is this
doable?
0
Tom1
11/18/2009 5:47:05 PM
"Tom1" <usernetuser@yahoo.com> wrote in message 
news:5d0dafb7-867f-4d84-b6c7-bf3b87ef96ea@b2g2000yqi.googlegroups.com...
On Nov 18, 12:13 pm, Tom Lavedas <tglba...@cox.net> wrote:
> On Nov 18, 11:58 am, Tom Lavedas <tglba...@cox.net> wrote:
>
>
>
>
>
> > On Nov 18, 11:40 am, Tom1 <usernetu...@yahoo.com> wrote:
>
> > > On Nov 18, 10:43 am, Tom Lavedas <tglba...@cox.net> wrote:
>
> > > > On Nov 18, 10:19 am, Tom1 <usernetu...@yahoo.com> wrote:
>
> > > > > I need a script to find out the number & total size of files based
> > > > > upon the file extention across about 30 servers. I'm searching for 
> > > > > mdb
> > > > > files. The script will be run remotely against local drives on 
> > > > > these
> > > > > servers. Thanks
>
> > > > <warning>
> > > > <aircode>
>
> > > > with createobject("scripting.filesystemobject")
> > > > aComputers = split(.opentextfile("D:\Someplace\complist.txt", _
> > > > 1).readall, vbnewline)
> > > > end with
>
> > > > nComputers = UBound(aComputers)
> > > > Redim aData(nComputers)
>
> > > > for i = 0 to nComputers
> > > > nSize = 0
> > > > nCount = 0
> > > > Set objWMIService = GetObject("winmgmts:" _
> > > > & "{impersonationLevel=impersonate}!\\" & _
> > > > aComputers(i) & "\root\cimv2")
> > > > Set colFiles = objWMIService.ExecQuery _
> > > > ("Select * from CIM_DataFile where Extension = 'mdb'", , 48)
> > > > For Each objFile in colFiles
> > > > nSize = nSize + objFile.size
> > > > Next
> > > > nCount = nCount + colFiles.count
> > > > aData(i) = Join(Array(aComputers(i), nCount, nSize), ", ")
> > > > Next
>
> > > > wsh.echo Join(aData, vbnewline)
>
> > > > </aircode>
> > > > </warning>
>
> > > > Another warning: CIM_DataFile searches are SLOW. Be prepared to W -
> > > > A - I - T.
> > > > _____________________
> > > > Tom Lavedas
>
> > > Thanks but I get the following error message:
>
> > > test.vbs(22, 5) Microsoft VBScript runtime error: Object doesn't
> > > support this property or method: 'size'
>
> > I was afraid of that - I keep forgetting what the differences are
> > between Shell.Application and FSO. OK, try this mod ...
>
> > set fso = createobject("scripting.filesystemobject")
> > with fso
> > aComputers = split(.opentextfile("D:\Someplace\complist.txt", _
> > 1).readall, vbnewline)
> > end with
>
> > nComputers = UBound(aComputers)
> > Redim aData(nComputers)
>
> > for i = 0 to nComputers
> > nSize = 0
> > nCount = 0
> > Set objWMIService = GetObject("winmgmts:" _
> > & "{impersonationLevel=impersonate}!\\" & _
> > aComputers(i) & "\root\cimv2")
> > Set colFiles = objWMIService.ExecQuery _
> > ("Select * from CIM_DataFile where Extension = 'mdb'", , 48)
> > For Each objFile in colFiles
> > nSize = nSize + fso.GetFile(objFile.Path).size
> > Next
> > nCount = nCount + colFiles.count
> > aData(i) = Join(Array(aComputers(i), nCount, nSize), ", ")
> > Next
>
> > wsh.echo Join(aData, vbnewline)
> > _____________________
> > Tom Lavedas
>
> Oops, wrong property. Change objFile.Path to objFile.Name.
>
> I told you I keep getting the differences confused.
>
> And, unless the administrative shares have been removed (C$, D$,
> etc.), Pegusus' approach is at least as good, if not better ...
>
> dir \\computername\C$\*.mdb /s | find " File(s) "
>
> I keep forgetting about the administrative share! (and this is a VBS
> group ;-)
> _____________________
> Tom Lavedas- Hide quoted text -
>
> - Show quoted text -

Thanks Tom

Is there a way to get just the total count & size? I just ran the
following command:

dir \\server1\h$:\*.ppt /s | find " File(s) "

          19 File(s)     49,850,383 bytes
           2 File(s)     14,699,520 bytes
          13 File(s)     20,429,824 bytes
           3 File(s)      8,284,672 bytes
           6 File(s)      9,275,392 bytes
           1 File(s)      2,814,464 bytes
           6 File(s)     28,538,880 bytes
           2 File(s)      9,221,632 bytes
           9 File(s)     16,318,976 bytes
           7 File(s)     11,241,472 bytes
          10 File(s)     46,939,648 bytes
           2 File(s)      6,682,112 bytes
           2 File(s)     12,724,224 bytes
          14 File(s)     30,193,152 bytes
           1 File(s)      5,980,160 bytes
           1 File(s)      1,647,104 bytes
           5 File(s)     29,892,096 bytes
           1 File(s)      2,814,464 bytes
           4 File(s)     13,792,256 bytes
           1 File(s)      3,254,784 bytes
         109 File(s)    324,595,215 bytes

As you can see, all I need is the 109 files & the 324,595,215 bytes in
the output (not interested in the numbers before that). Is this
doable?

======

Sure is - with a little batch file (which is often frowned upon in this 
newsgroup):

[1] @echo off
[2] for /F "tokens=3" %%a in ('dir \\server1\h$:\*.ppt /s ^| find " File(s) 
"') do set Total=%%a
[3] echo Total=%Total%

You need to unwrap wrapped lines (if necessary) and remove the line numbers. 
If desired then you can expand the above batch script so that it scans a 
whole set of servers and adds up the numbers to a grand total. 


0
Pegasus
11/18/2009 6:15:23 PM
On Nov 18, 1:15=A0pm, "Pegasus [MVP]" <n...@microsoft.com> wrote:
> "Tom1" <usernetu...@yahoo.com> wrote in message
>
>{snip}
>
> Sure is - with a little batch file (which is often frowned upon in this
> newsgroup):
>
> [1] @echo off
> [2] for /F "tokens=3D3" %%a in ('dir \\server1\h$:\*.ppt /s ^| find " Fil=
e(s)
> "') do set Total=3D%%a
> [3] echo Total=3D%Total%
>
> You need to unwrap wrapped lines (if necessary) and remove the line numbe=
rs.
> If desired then you can expand the above batch script so that it scans a
> whole set of servers and adds up the numbers to a grand total.

My personal choice would be something like this...

 @echo off
  setlocal
  for /F "tokens=3D1,3" %%a in (
    'dir dir \\server1\h$\*.mdb /s /-c^| find " File(s)"'
    ) do set /a FileCount=3D%%a,Total=3D%%b
  echo %FileCount% files totaling %Total% bytes

Pegusus: Note the /-C switch to remove the commas from the listing.
Also, the colon after the share name does not belong.
_____________________
Tom Lavedas
0
Tom
11/18/2009 7:41:52 PM
"Tom Lavedas" <tglbatch@cox.net> wrote in message 
news:6202aad0-14dc-47bd-86b0-f1a2a7ffc55c@d10g2000yqh.googlegroups.com...
On Nov 18, 1:15 pm, "Pegasus [MVP]" <n...@microsoft.com> wrote:
> "Tom1" <usernetu...@yahoo.com> wrote in message
>
>{snip}
>
> Sure is - with a little batch file (which is often frowned upon in this
> newsgroup):
>
> [1] @echo off
> [2] for /F "tokens=3" %%a in ('dir \\server1\h$:\*.ppt /s ^| find " 
> File(s)
> "') do set Total=%%a
> [3] echo Total=%Total%
>
> You need to unwrap wrapped lines (if necessary) and remove the line 
> numbers.
> If desired then you can expand the above batch script so that it scans a
> whole set of servers and adds up the numbers to a grand total.

My personal choice would be something like this...

 @echo off
  setlocal
  for /F "tokens=1,3" %%a in (
    'dir dir \\server1\h$\*.mdb /s /-c^| find " File(s)"'
    ) do set /a FileCount=%%a,Total=%%b
  echo %FileCount% files totaling %Total% bytes

Pegusus: Note the /-C switch to remove the commas from the listing.
Also, the colon after the share name does not belong.
_____________________
Tom Lavedas

==========

Thanks for picking up the extra colon. It was actually the OP's doing but I 
admit that I overlooked it. In your code there is an oversight too - the two 
"dir dir" commands should proably be reduced to just one.

I'm aware of the /-c switch for the "dir" command - it would come in handy 
if the OP decided to total up the numbers from several servers. Conversely - 
why would you use the /a switch for the "set" command? You're not 
calculating any arithmetic expression.

I note with concern that we're deep into a batch file discussion even though 
we're in a VB Scripting group. I can feel the flames scorching my backside. 


0
Pegasus
11/18/2009 8:18:03 PM
On Nov 18, 3:18=A0pm, "Pegasus [MVP]" <n...@microsoft.com> wrote:
> "Tom Lavedas" <tglba...@cox.net> wrote in message
>
> news:6202aad0-14dc-47bd-86b0-f1a2a7ffc55c@d10g2000yqh.googlegroups.com...
> On Nov 18, 1:15 pm, "Pegasus [MVP]" <n...@microsoft.com> wrote:
>
>
>
> > "Tom1" <usernetu...@yahoo.com> wrote in message
>
> >{snip}
>
> > Sure is - with a little batch file (which is often frowned upon in this
> > newsgroup):
>
> > [1] @echo off
> > [2] for /F "tokens=3D3" %%a in ('dir \\server1\h$:\*.ppt /s ^| find "
> > File(s)
> > "') do set Total=3D%%a
> > [3] echo Total=3D%Total%
>
> > You need to unwrap wrapped lines (if necessary) and remove the line
> > numbers.
> > If desired then you can expand the above batch script so that it scans =
a
> > whole set of servers and adds up the numbers to a grand total.
>
> My personal choice would be something like this...
>
> =A0@echo off
> =A0 setlocal
> =A0 for /F "tokens=3D1,3" %%a in (
> =A0 =A0 'dir dir \\server1\h$\*.mdb /s /-c^| find " File(s)"'
> =A0 =A0 ) do set /a FileCount=3D%%a,Total=3D%%b
> =A0 echo %FileCount% files totaling %Total% bytes
>
> Pegusus: Note the /-C switch to remove the commas from the listing.
> Also, the colon after the share name does not belong.
> _____________________
> Tom Lavedas
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> Thanks for picking up the extra colon. It was actually the OP's doing but=
 I
> admit that I overlooked it. In your code there is an oversight too - the =
two
> "dir dir" commands should proably be reduced to just one.
>
> I'm aware of the /-c switch for the "dir" command - it would come in hand=
y
> if the OP decided to total up the numbers from several servers. Conversel=
y -
> why would you use the /a switch for the "set" command? You're not
> calculating any arithmetic expression.
>
> I note with concern that we're deep into a batch file discussion even tho=
ugh
> we're in a VB Scripting group. I can feel the flames scorching my backsid=
e.

The group has tuned this thread out already, I would guess.

The double 'dir' is a c&p problem - thanks for catching that.

I removed the commas to get the complete number.  Otherwise, it would
have just collected the most significant grouping in the US.  You're
in an locale that uses dots, I believe, so what you posted will work
as expected.  Here in the US, the standard comma separator causes
problems because it is also a command line delimiter.

Finally, I used the /A so I could collect both the file count and size
numbers in one SET statement using the comma 'expression
separator' (last operand in the SET help listing).  (That's another
reasons for the /A switch in the SET.)
_____________________
Tom Lavedas
0
Tom
11/18/2009 9:04:16 PM
On Nov 18, 12:14=A0pm, Tom1 <usernetu...@yahoo.com> wrote:

>
> Still not working -- test.vbs(24, 5) Microsoft VBScript runtime error:
> File not found

OK.  I give up on that approach.  It's too slow anyway.  However, you
can do it in VBS with a recursive search using FSO via the
administrative share, as we did with the command line DIR.

Something like this ...

set ofs =3D createobject("scripting.filesystemobject")
aComputers =3D split(fso.opentextfile("D:\Someplace\complist.txt", _
                1).readall, vbnewline)

nComputers =3D UBound(aComputers)
Redim aData(nComputers)

for i =3D 0 to nComputers
  nSize =3D 0
  nCount =3D 0
  dpath =3D "\\" & aComputers(i) & "\C$\"
  getSize dPath, "mdb", nCount, nSize, fso
  aData(i) =3D Join(Array(aComputers(i), nCount, nSize), ", ")
Next

wsh.echo Join(aData, vbnewline)

Sub getSize(sPath, sExt, nCount, nSize, ofs)
Dim s
  s =3D ""
  With ofs.GetFolder(sPath)
    getFileSize .files, sExt, nCount, nSize, fso
    if .SubFolders.Count > 0 Then
      For each folder in .SubFolders
        getSize sPath & "\" & folder.Name, sExt, nCount, nSize, ofs
      Next
    End if
  End With
End Sub

Sub getFileSize(cFiles, sExt, nCount, nSize, fso)
  For each file in cFiles
    if lcase(ofs.getExtensionName(file.name)) =3D lcase(sExt) then
      nCount =3D nCount + 1
      nSize =3D nSize + file.size
    end if
  Next
end sub
_____________________
Tom Lavedas
0
Tom
11/18/2009 10:16:41 PM
"Pegasus [MVP]" <news@microsoft.com> wrote in message 
news:ef0K9wIaKHA.5348@TK2MSFTNGP06.phx.gbl...
> snip
>
> I note with concern that we're deep into a batch file discussion even 
> though we're in a VB Scripting group. I can feel the flames scorching my 
> backside.

Seems to me that this batch file will be called from a VBScript and perhaps 
its output will be redirected to the same VBScript, all within a Microsoft 
OS.  To me that is a good enough reason to have this discussion nere, on how 
to get accurate results to the OP's need without having to wait for the slow 
WMI processing that few would quibble with discussing here.

-Paul Randall 


0
Paul
11/19/2009 12:57:02 AM
On Nov 18, 3:18=A0pm, "Pegasus [MVP]" <n...@microsoft.com> wrote:
> "Tom Lavedas" <tglba...@cox.net> wrote in message
>
> news:6202aad0-14dc-47bd-86b0-f1a2a7ffc55c@d10g2000yqh.googlegroups.com...
> On Nov 18, 1:15 pm, "Pegasus [MVP]" <n...@microsoft.com> wrote:
>
>
>
>
>
> > "Tom1" <usernetu...@yahoo.com> wrote in message
>
> >{snip}
>
> > Sure is - with a little batch file (which is often frowned upon in this
> > newsgroup):
>
> > [1] @echo off
> > [2] for /F "tokens=3D3" %%a in ('dir \\server1\h$:\*.ppt /s ^| find "
> > File(s)
> > "') do set Total=3D%%a
> > [3] echo Total=3D%Total%
>
> > You need to unwrap wrapped lines (if necessary) and remove the line
> > numbers.
> > If desired then you can expand the above batch script so that it scans =
a
> > whole set of servers and adds up the numbers to a grand total.
>
> My personal choice would be something like this...
>
> =A0@echo off
> =A0 setlocal
> =A0 for /F "tokens=3D1,3" %%a in (
> =A0 =A0 'dir dir \\server1\h$\*.pst /s /-c^| find " File(s)"'
> =A0 =A0 ) do set /a FileCount=3D%%a,Total=3D%%b
> =A0 echo %FileCount% files totaling %Total% bytes
>
> Pegusus: Note the /-C switch to remove the commas from the listing.
> Also, the colon after the share name does not belong.
> _____________________
> Tom Lavedas
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> Thanks for picking up the extra colon. It was actually the OP's doing but=
 I
> admit that I overlooked it. In your code there is an oversight too - the =
two
> "dir dir" commands should proably be reduced to just one.
>
> I'm aware of the /-c switch for the "dir" command - it would come in hand=
y
> if the OP decided to total up the numbers from several servers. Conversel=
y -
> why would you use the /a switch for the "set" command? You're not
> calculating any arithmetic expression.
>
> I note with concern that we're deep into a batch file discussion even tho=
ugh
> we're in a VB Scripting group. I can feel the flames scorching my backsid=
e.- Hide quoted text -
>
> - Show quoted text -

I ran the above script against a 2TB drive. Here is the script output
(after 2 hours & 55 minutes of parsing the data):

Invalid number.  Numbers are limited to 32-bits of precision.
Invalid number.  Numbers are limited to 32-bits of precision.
Invalid number.  Numbers are limited to 32-bits of precision.
1667 files totaling 15508480 bytes

The above results (1667 files totaling 15508480 bytes) are not
correct. The correct numbers are:

Total bytes: 591,657,988,611 (577,791,004.50 KB) (564,249.03 MB)
Total files: 1670   Average size: 354,286,220 bytes
Smallest: 0 bytes   Largest: 6,998,934,528 bytes

0
Tom1
11/19/2009 9:27:04 PM
"Tom1" <usernetuser@yahoo.com> wrote in message 
news:d1a9ea69-55fb-47d5-84d9-2f679f6de8cc@f16g2000yqm.googlegroups.com...
On Nov 18, 3:18 pm, "Pegasus [MVP]" <n...@microsoft.com> wrote:
> "Tom Lavedas" <tglba...@cox.net> wrote in message
>
> news:6202aad0-14dc-47bd-86b0-f1a2a7ffc55c@d10g2000yqh.googlegroups.com...
> On Nov 18, 1:15 pm, "Pegasus [MVP]" <n...@microsoft.com> wrote:
>
>
>
>
>
> > "Tom1" <usernetu...@yahoo.com> wrote in message
>
> >{snip}
>
> > Sure is - with a little batch file (which is often frowned upon in this
> > newsgroup):
>
> > [1] @echo off
> > [2] for /F "tokens=3" %%a in ('dir \\server1\h$:\*.ppt /s ^| find "
> > File(s)
> > "') do set Total=%%a
> > [3] echo Total=%Total%
>
> > You need to unwrap wrapped lines (if necessary) and remove the line
> > numbers.
> > If desired then you can expand the above batch script so that it scans a
> > whole set of servers and adds up the numbers to a grand total.
>
> My personal choice would be something like this...
>
> @echo off
> setlocal
> for /F "tokens=1,3" %%a in (
> 'dir dir \\server1\h$\*.pst /s /-c^| find " File(s)"'
> ) do set /a FileCount=%%a,Total=%%b
> echo %FileCount% files totaling %Total% bytes
>
> Pegusus: Note the /-C switch to remove the commas from the listing.
> Also, the colon after the share name does not belong.
> _____________________
> Tom Lavedas
>
> ==========
>
> Thanks for picking up the extra colon. It was actually the OP's doing but 
> I
> admit that I overlooked it. In your code there is an oversight too - the 
> two
> "dir dir" commands should proably be reduced to just one.
>
> I'm aware of the /-c switch for the "dir" command - it would come in handy
> if the OP decided to total up the numbers from several servers. 
> Conversely -
> why would you use the /a switch for the "set" command? You're not
> calculating any arithmetic expression.
>
> I note with concern that we're deep into a batch file discussion even 
> though
> we're in a VB Scripting group. I can feel the flames scorching my 
> backside.- Hide quoted text -
>
> - Show quoted text -

I ran the above script against a 2TB drive. Here is the script output
(after 2 hours & 55 minutes of parsing the data):

Invalid number.  Numbers are limited to 32-bits of precision.
Invalid number.  Numbers are limited to 32-bits of precision.
Invalid number.  Numbers are limited to 32-bits of precision.
1667 files totaling 15508480 bytes

The above results (1667 files totaling 15508480 bytes) are not
correct. The correct numbers are:

Total bytes: 591,657,988,611 (577,791,004.50 KB) (564,249.03 MB)
Total files: 1670   Average size: 354,286,220 bytes
Smallest: 0 bytes   Largest: 6,998,934,528 bytes

==============

I'm not surprised. When running such programs, whether as batch files or as 
VB Script files, one needs to size up the numbers expected, then adjust the 
code so that one stays within acceptable bounds. When it comes to disk space 
then I would restrict myself to MBytes. No point in going down to Bytes.

I would also run a test on a medium-size disk to determine which is faster, 
a VB Script based on the File System Object or a batch file. And if you want 
quick results then a batch file invoked remotely, using psexec.exe, will 
beat the lot while creating negligible network traffic. 


0
Pegasus
11/19/2009 9:41:19 PM
"Pegasus [MVP]" <news@microsoft.com> wrote in message 
news:ef0K9wIaKHA.5348@TK2MSFTNGP06.phx.gbl...
>
> "Tom Lavedas" <tglbatch@cox.net> wrote in message 
> news:6202aad0-14dc-47bd-86b0-f1a2a7ffc55c@d10g2000yqh.googlegroups.com...
> On Nov 18, 1:15 pm, "Pegasus [MVP]" <n...@microsoft.com> wrote:
>> "Tom1" <usernetu...@yahoo.com> wrote in message
>>
>>{snip}
>>
>> Sure is - with a little batch file (which is often frowned upon in this
>> newsgroup):
>>
>> [1] @echo off
>> [2] for /F "tokens=3" %%a in ('dir \\server1\h$:\*.ppt /s ^| find " 
>> File(s)
>> "') do set Total=%%a
>> [3] echo Total=%Total%
>>
>> You need to unwrap wrapped lines (if necessary) and remove the line 
>> numbers.
>> If desired then you can expand the above batch script so that it scans a
>> whole set of servers and adds up the numbers to a grand total.
>
> My personal choice would be something like this...
>
> @echo off
>  setlocal
>  for /F "tokens=1,3" %%a in (
>    'dir dir \\server1\h$\*.mdb /s /-c^| find " File(s)"'
>    ) do set /a FileCount=%%a,Total=%%b
>  echo %FileCount% files totaling %Total% bytes
>
> Pegusus: Note the /-C switch to remove the commas from the listing.
> Also, the colon after the share name does not belong.
> _____________________
> Tom Lavedas
>
> ==========
>
> Thanks for picking up the extra colon. It was actually the OP's doing but 
> I admit that I overlooked it. In your code there is an oversight too - the 
> two "dir dir" commands should proably be reduced to just one.
>
> I'm aware of the /-c switch for the "dir" command - it would come in handy 
> if the OP decided to total up the numbers from several servers. 
> Conversely - why would you use the /a switch for the "set" command? You're 
> not calculating any arithmetic expression.
>
> I note with concern that we're deep into a batch file discussion even 
> though we're in a VB Scripting group. I can feel the flames scorching my 
> backside.

Then I need not say anything about it... ;-)

Of course, this type of thing would be even easier in Powershell (another 
non-vbscript language), in which files and folders are objects with 
properties like "size", and in which numbers with more than 9 digits 
overflow.

/Al
 

0
Al
11/20/2009 3:09:37 AM
Reply:

Similar Artilces:

Data file security
After viewing my MONEY (*.mny) with a hex viewer it appears to be encrypted (as expected). Does anyone know the details of this encryption? How secure is it, especially from being compromised via the internet? The data itself it encrypted, however if a 3rd party were to get the file, it could be compromised fairly simply through the use of a password cracker. The question would be how would someone get access to your file; by the internet or otherwise -- I'd say the odds would be slim. -- "Jerry" <gkaluzny@wi.rr.com> wrote in message news:_Os_a.107348$6a3.3173941@tw...

Can't open more than one file.
I have looked and looked but only seen one or two vague references t this problem. This has started only recently...I can only open one excel file at time. That is, if I have an excel file open and I click on another, th first one closes. I used to be able to have multiple excel files open. I am starting to think it may be a memory problem but don't know how t prove it. (Using win98). Thanks for any help -- adnum ----------------------------------------------------------------------- adnum8's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2928 View this t...

An XML question
I would like to produce the following output based on my XML file: My Album (2005) Elapsed Time (hh:mm:ss): 00:07:00 Song 1: title1 Length (hh:mm:ss): 00:02:30 Song 2: title2 Length (hh:mm:ss): 00:02:15 Song 3: title3 Length (hh:mm:ss): 00:02:15 ===== <album> <general> <title>My Album</title> <year>2005</year> </general> <content> <song> <songTitle>title1</songTitle> <songLengthInSeconds>150</songLengthInSeconds> </song> <song> <...

macro to read and sort data from multiple text files
Hello there !! I have x number of ascii text files that have space delimited data columns (files may have 3 to 40 data columns). There are about 25 header rows at the top of each file but I am not going to use info from these rows. I also have a master.xls file. Could someone please help me create a macro to do the following - A) read first *.txt file from the given folder into sheet1 of the master.xls file. NOTE: I have already set up the sheet2 of the master.xls to sort required rows of data from sheet1 (based on row headers) using vlookup to populate a 40 column wide array. B) Copy the ...

a question to get the size of current Cursor?
This is a multi-part message in MIME format. ------=_NextPart_000_00B7_01C3972A.54ADC200 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit Hello,Everyone,I don't know how to get the current Cursor size; I write this code .. ................... HCURSOR hcur = GetCursor(); ICONINFO iconinfo; GetIconInfo(hcur,&iconinfo); CBitmap bitmap,bitmap1; bitmap1.Attach(iconinfo.hbmColor) bitmap.Attach(iconinfo.hbmMask); BITMAP bmp; bitmap.GetBitmap(&bmp); CSize sizeMouseLast(bmp.bmWidth,bmp.bmHeight); ............................. the size ...

Totals on Sales Inquiry native windows
We would like to have the totals on the Sales Inquiries: Transaction by Customer Transaction by Document Sales Documents Sales Items Today we can retrieve this information in separated inquiries and reports, be we would like to heve a easier way to see this totals... The same suggest can be applied to Smartlist. If possible, you can create a tool to sum a field after you make a filter I created a screen where you can see all sales, separated by day of week, and week of year, and totals YTD,MTD and WTD, but I am not able to have the same information grouped by item number, for example.....

Outlook export to PST file
I am running outlook 2000 with SP3 on Windows XP SP2. I am trying to archive my old email by creating an PST file using the import/export utility within outlook. I am able to run through the wizard ok, but when I click on 'finish' I recieve the pop-up 'Item not found'. This happens no matter how many emails are in the folder. What could the problem be? Regards Paul Roberts. The right way to make a full backup is simply to close Outlook and make = a copy of the existing PST file.=20 --=20 Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http:/...

Problem reducing Excel 2007 file size
We have a largish 2007 xlsx from which we deleted large chunks of validation and formatting which were no longer needed. After a save (even a "save as" to a new file), the file size did not change! Any idea of what's going on here or what we could do to reduce the size of the file? Thanks in advance! go to each sheet and check what the last cell is -- perhaps there are some erroneous last cells --delete rows & columns after the "real" last cell. "Intuitive Analyst" <IntuitiveAnalyst@discussions.microsoft.com> wrote in message news:0732AE09-676...

.DLL file could not be found
The message below is what comes up when I try to open MS Outlook. I have tried numerous patches from Microsoft and have deleted and re-loaded Office on my PC. Have also contacted Dell but they were not able to help me. Does anyone know how to fix this problem? Unable to open your default e-mail folders. The .DLL file for the information service could not be found. MAPI was unable to load the information service PSTPRX.DLL. Be sure the service is correctly installed and configured. Thanx!!! ...

How do I convert a word file to mpg or pdf?
to convert from 2003 word document to mpg/pdf file mpg is a video format and has nothing to do with Word. PDF is a graphical format for which you will need a third party converter such as Acrobat or one of its lesser clones such as PrimoPDF -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> <>>< ><<> <>>< <>><<...

total cost on report
I have areport with a cost field that I would like to total that collum at the end of the report. How do I do this ? do I need to create another field (total) please help thanks, jettro Jettron wrote: >I have areport with a cost field that I would like to total that collum at >the end of the report. How do I do this ? do I need to create another field >(total) The usual way is to use a text box with an expression like: =Sum([cost field]) -- Marsh MVP [MS Access] I'm in design view of the report, where do I insert this expression? I clicked on page footer to insert thi...

displaying a file
I have problem regarding displaying a file....I have used CFileDialog to create a open dialog but when i cancel it i am getting a dialog.And once i have opened the file....i getting newline charaters as well in the edit box.The formatting is totally gone.However when i display it on to a message box,i getting the exact format.Please help. Jeevan, You don�t say what kind of dialog you get when you cancel, so it is hard to know the problem. Perhaps you have a bug :-) As for formatting, you'll have to either use a control that will do your formatting (such as an editbox with the multilin...

Edit files with no extension
Still trying to figure this one out: I want to edit aspx files that do not have the .aspx extension. Is this possible while still getting the statement completion, text colorization and highlighting in Microsoft Visual Studio Dot Net Enterprise Architect? I wish to use an alternative extension (or no extension at all) and still get text highlighting that you would find for a .aspx extension. I was originally told to edit the registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Editors\{8281C572-217 1-45AA-A642-7D8BC1662F1C}\Extensions. I added a new DWORD Value with the title &...

Recovering .pst file for Outlook 2003 beta
Outlook 2003 beta ran out without warning. (Oops.) Went back to Outlook 2002 but in the process the .pst file has disappeared. Is there any way to recover? Search doesn't find it, can't find even a corrupted file to repair. --MGee You need to go into My Computer (or Windows Explorer) Tools | Folder Options | View (If I recall correctly) and click the radio button to have Windows "Show All Files". The .PST file is considered a system file under Windows XP. -- Aloha, -Ben- Ben M. Schorr, OneNote-MVP http://home.hawaii.rr.com/schorr **I apologize but I am unable ...

Picture size increase/decrease in size using code
Hi, Is it possible to have a macro which will blow a picture up when you click on it, and then will shrink it again if clicked again, and will work on any picture i.e. only one macro need be written? Regards John Just thought of something that would probably be better. Is it possible to click on the picture so that it would open in a new window so that you can use the X to close again? The workbook would have approx 200 pictures, so if at all possible have one code that can pick up any picture Help greatly appreciated. Many thanks John "JohnUK" wrote: > ...

Setting ID# to 1 & Total on bottom of query result
Hi, I have 2 separate questions. First how do I set the ID# to 1 for the first record. I copied my whole database including queries and forms which were 2009 records and changed the titles to 2010. I did a "compact and repair" to the 2010 database. But when I start to enter records for 2010 the ID# is 2550. How can I reset the ID# back to start at 1? On many of my queries I have the results be for example 28 Caucation, 43 African American, 65 Hispanic, 4 Asian, 2 Native American. I need these numbers separate like they are but I would like a total line at the bottom...

The location of C:\Documents and Settings\User\Local Settings\Temporary Internet Files\OLKE5\file name
I am trying to find out where Outlook 2002 sets the location "C:\Documents and Settings\User\Local Settings\Temporary Internet Files\OLKE5\" as the default for opening up an attachment in an email. When I have an email with an attachment and I double click it to open it within the email, the attachment opens up in the proper application, but if I try to do a save as it will try to save it to the location mentioned above as a default. We were having some problems opening a specific rtf attachment that was being sent daily and nightly to several recipients. The email attachment had ...

fonts change size
hi, whenever i open up outlook xp, my internet explorer and webmail account fonts become very small. i need to change the font again. how do i fix this annoying problem? thanks. manpreet ...

Finding Cells that Total a Value
Hello Friends, I need some assistance in solving a problem. I have a spreadsheet with over five hundred lines of transactions. The sum of these transactions are creating a balance on the account. Is there any formula/macro that will help me find the transactions creating the balance? The sum of the account should be zero. To clarify, if we owe client money, there would be a transaction setting up that postive balance then a payment on the account taking it back to zero. There could be multiple transactions and then one net payment. Or we could be due to receive. So at the end of the day, th...

Linking to an Excel File with a Password
Hi - I wonder if any one could help I am within Access trying to link to a excel table that is password protected and the area on the network is read only. Everytime I try and open the file it comes up with the message "Could not decrpt file". We need to password protect the file due to the high security issues I look forward to hearing from anyone out there who could help Thanks ...

Files in Blue
In recent weeks when i open up a file there are some worksheets in Blue while others are in normal black. Has some thing changed? JGrow You can tell windows to compress files to save space. Open Windows explorer Locate your file rightclick on it and choose properties|general tab click the advanced button and you'll see how to toggle it on/off. There may be an option to do this to at a drive level--I don't recall. JulianB wrote: > > In recent weeks when i open up a file there are some worksheets in Blue while > others are in normal black. Has some thing changed? > &...

Developer friendly definition of TLB files
Folks Does anyone have a developer friendly definition of TLB files? Not for the likes of Karl Peterson and others in this newsgroup who understand subclassing. But for the likes of people like me. <smile> I'd like to put in a few sentences in a blog posting I'm doing about ADO versions. Which depend on TLB files. Tony -- Tony Toews, Microsoft Access MVP Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/ For a convenient utility to keep your users FEs and other files ...

Total Items
Hi - Is there a way to get a total number of items that are about to be tendered, on the POS screen ? Thanks. You can customize the status.htm file. Not sure exactly what the variable is that you want, but I know it cn be done. "NJS" <NJS@discussions.microsoft.com> wrote in message news:538F3CC7-F23D-43C7-8A5A-4319B8688E5B@microsoft.com... > Hi - > Is there a way to get a total number of items that are about to be > tendered, > on the POS screen ? > Thanks. Jason, Send me your email I have already customized this and will forward you. "Jason&qu...

Reserved excel file
What does it mean when you open a excel file and it says *.xls is reserved by "user name"? ...

Auto/Manual Calculation using *.slk files
I'm going a little crazy with Excel today. I am attempting to write a macro that will allow a user to open two additional spreadsheets (*.slk files) generated by the same external utility. I have a very complicated worksheet that analyzes the data from these worksheets. As such I have made sure that the main workbook has calculate set to MANUAL. When I open the first *.slk file and copy the needed data and paste the data everything works fine (i.e. NO CALCULATIONS). However,when I load the second file this *.slk file opens and immediately performs a calculate which takes several minu...