Re: Script which is running very slowly...
- From: Corné Bogaarts <does.not.exist@xxxxxxxxxxxxx>
- Date: Thu, 31 Mar 2005 23:50:30 +0200
Did you ever try TreeSize (http://www.jam-software.com).
You can run it from a command-line, batchfile or script.
On Thu, 31 Mar 2005 06:07:06 -0800, "Morten_Leth"
<Morten_Leth@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>Hey everyone
>
>I have a little problem with my script which..
>I have been assigned a task, to make a script which enumerate how much a
>user uses of diskspace...
>
>I know why it runs slowly, first... I Use Winnt (don't know how to use LDAP
>to do it) and then i run the script for every group in the domain, and then
>again for every user in the groups... (again, i can't see how i can do
>anything about it.)
>
>my next problem is that i can't get the script to write 0,00 if the value is
>0, this is probably because i use Round()
>
>Here's the script....
>
>
>option explicit
>
>dim strDomain, objDomain, network, objGroup, strStartGroup, strNumber, _
>objUser, strMB, FSO, objFSO, strFolderSize, strUserGroup, strTotal
>
>Set Network = Wscript.CreateObject("Wscript.Network")
>StrDomain = Network.UserDomain
>Set fso = CreateObject("Scripting.FileSystemObject")
>
>Set objDomain = GetObject("WinNT://" & StrDomain)
>objDomain.Filter = Array("group")
>For Each objGroup In objDomain
>if Len(objGroup.Name) = 13 then
>strStartGroup = ucase(left(objGroup.Name, 10))
>strNumber = mid(objGroup.Name, 11)
> if strStartGroup = "GGMAG4AZKS" then
>on error resume next
> if strNumber = 0 then
>
> else
> for each objUser in objGroup.members
> Set objFSO = fso.GetFolder("\\mag4azkssc1fil2\brugerdata$\" &
>objUser.Name)
> strMB = objFSO.size /1048576
> strFolderSize = "\\mag4azkssc1fil2\brugerdata$\" & objFSO.Name & " ;
>" & Round(strMB, 2) & vbCrLf & strFolderSize
> if strMB = 0 then
> strMB = "0,00"
> else
>
> end if
> strTotal = Round(strMB, 2) + strTotal
>
> next
> strUserGroup = objGroup.Name & "- " & objGroup.Description & vbCrLf &
>"------------------- " & vbCrLf & strFolderSize & vbCrLf & "Total = " &
>Round(strTotal, 2)
> wscript.echo strUserGroup
> strTotal = 0
> end if
>err.clear
>on error goto 0
> else
>
> end if
>else
>
>end if
>Next
>wscript.echo strUserGroup
>
>Hope anyone can help....
>
>/Leth
.
- Follow-Ups:
- Re: Script which is running very slowly...
- From: Morten_Leth
- Re: Script which is running very slowly...
- References:
- Script which is running very slowly...
- From: Morten_Leth
- Script which is running very slowly...
- Prev by Date: Re: Error handling problem.
- Next by Date: Re: FSO
- Previous by thread: Script which is running very slowly...
- Next by thread: Re: Script which is running very slowly...
- Index(es):
Relevant Pages
|