Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Folder size

Status
Not open for further replies.

LeighTT

Technical User
Feb 12, 2003
15
0
0
GB
I have written as script that checks the last accessed date and and size of shares on a server. This works fine on servers with fairly small share'd area's. The problem I have is with large dept shares that maybe 50GB plus. I,m using the Getfolder command as below to accertain the size

Set f = objfso.GetFolder ("\\"& strcomputer & "\" & (strsharepath))
s = f.size & " bytes."
ShowFolderSize = s

If I use this against a large share folder after approx 20 minutes the script returns (path not found)

My question is: Is there a limit to the folder size that I can ref using this method. I would also point out I am running this script remotley to minimise impact on production server.

Any help most welcome
 
If your folders are very deep and big, then make sure to check your server timeout value, as this may take a while to run.
 
Scratch that. My goof.

You may want Remote WSH:


The idea is that if the remote server is set up right, your desktop WSH script can send a script to the remote server and run it there. This might run a lot quicker than calculating the folder size over the wire.

Just have the remote script write its result to a file on a share you can get at from your desktop. Then the "parent" script on your desktop can open this and read the results after the remote script finishes.
 
I know this is a late post, but thought I'd share some information..

Calculating file sizes has nothing to do with copying every byte from the remote server.. it's just querying the size property of the remote folder, and passing that longint across the wire.

It also will not improve performance of the remote server by running it remotely. The remote server still has to calculate the folder size before sending it to the calling program (on your local machine).

The reason it may be sending an error is either because it's on the root of a drive (if IsRootFolder() is true, the Size property will return a "Path not found" error). It may also be a timeout, as chmohan mentioned.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top