|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Check Folder SizeHi,
The drives are running out of space on a Server, I would like to know which is the folder taking too much of space. Is there any scripts which help in finding the folder size...rather than clicking on each folder to know the size. Please help me... Thanks, Sharath Hello sharath_bujji,
With: http://www.google.de/search?hl=de&q=view+folder+size&meta=&aq=0&oq=view+folder you will find some 3rd party tools, some are also freeware. Best regards Meinolf Weber Disclaimer: This posting is provided "AS IS" with no warranties, and confers no rights. ** Please do NOT email, only reply to Newsgroups ** HELP us help YOU!!! http://www.blakjak.demon.co.uk/mul_crss.htm Show quoteHide quote > Hi, > > The drives are running out of space on a Server, I would like to know > which is the folder taking too much of space. Is there any scripts > which help in finding the folder size...rather than clicking on each > folder to know the size. > > Please help me... > > Thanks, > Sharath [code]
'======================================================================= === ' ' NAME: FolderSizes.vbs ' ' AUTHOR: Mark D. MacLachlan , The Spider's Parlor ' URL: http://www.thespidersparlor.com ' DATE : 12/23/2003 ' ' COMMENT: ' ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED To ' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A ' PARTICULAR PURPOSE. ' ' IN NO EVENT SHALL THE SPIDER'S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS ' BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY ' DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, ' WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ' ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE ' OF THIS CODE OR INFORMATION. ' '======================================================================= === 'Check all subfolders below given folder for size over a minimum size. Dim FolderPath Dim FolderSize Dim MinSize Set objArgs=WScript.Arguments FolderPath=objArgs(0) MinSize=CLng(objArgs(1)) Const CONVERSION_FACTOR = 1048576 'converts folder size to MB 'Const MinSize = 100 'set minimum folder size in MB. If Wscript.Arguments.count = 0 Then Wscript.Echo "Usage: foldersize.vbs [folder][minimum size]" Wscript.Echo "Example: foldersize.vbs c:\myfolder 50" Wscript.Quit End If 'FolderPath = Wscript.Arguments(0) 'MinSize = Wscript.Arguments(1) report = "Folder Size" & vbTab &"Folder Name" & vbCrLf Set FSO = CreateObject ("Scripting.FileSystemObject") ShowSubFolders FSO.GetFolder(FolderPath) MsgBox Report Sub ShowSubFolders (Folder) For Each SubFolder In Folder.SubFolders FolderSize = SubFolder.Size / CONVERSION_FACTOR If FolderSize > MinSize Then report = report & int(FolderSize) & vbTab & vbTab & SubFolder.Path & vbCrLf End If ShowSubFolders SubFolder Next End Sub [/code] Hope that helps, Mark D. MacLachlan Hi, if it you have few folders you can use the batchfile
this applies for a single folder. Make a batchfile with all your folder list and make the folderlist in the file to run this script. Folder size batch file- @echo off setLocal EnableDelayedExpansion set /a value=0 set /a sum=0 FOR /R %1 %%I IN (*) DO ( set /a value=%%~zI/1024 set /a sum=!sum!+!value! ) @echo Size is: !sum! k -- dileep.ponna ------------------------------------------------------------------------ dileep.ponna's Profile: http://forums.techarena.in/members/88349.htm View this thread: http://forums.techarena.in/active-directory/1208824.htmhttp://forums.techarena.in |
|||||||||||||||||||||||