• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 229
  • Last Modified:

script to let me know disk space usage

Good Day All,

Because of depleting hard drive space my boss asked me to come up with a script that will enable me to know who specifically is taking more than 400 megs of space. Since I know nothing of scripting could someone please point me in the right direction to obtain such a script. The company is running Windows 2000 server with AD sp4.

Many thanks,

Tacobell2000
0
Tacobell2000
Asked:
Tacobell2000
  • 2
  • 2
  • 2
  • +1
1 Solution
 
gavin_wickensCommented:
Do you mean local drive space or network drive space?  You could use disk quota on the server.
0
 
Tacobell2000Author Commented:
Sorry...I mean network drive space. We have about 1000 users and I would like to know say users that have more than 400 megs  of space used on their personal drive. So the script will tell me which users are over the 400 meg and i in turn will inform my boss with the results of the script. The script should if possible create a txt file with all the users taking over 400 megs of disk space on the server.

Thanks,

Tacobell2000
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
ZnalostCommented:
Hi Tacobell2000,
It is not clear from your statement therefore I assume that each user's personal drive is actualy represented by a folder located on a file server. As others suggested above, you can use diruse.exe to find out how much space each user consumes.
I developed for myself a litlle script (using windows command shell and diruse.exe) which makes evaluation of directory utilization a little bit easer. If you want you can use it.
Create a file called ru.bat and open it in notepad. Then place in it following (content between double lines):
==============================================
@echo off
if "%1"=="" goto interactive
set fileredir= ^>^> %3
if "%3"=="" goto noredir
diruse /m /, /q:%1 /l /* %2 %fileredir%
goto konec
:noredir
diruse /m /, /q:%1 /l /* %2
rem diruse /m /, /q:10000 /l /* h:\users
pause
goto konec
:interactive
rem Interactive part and help of this program starts here
echo -----------------------------------------------------------------------
echo This program lists directory sizes (including subdirectories and
echo files in the subdirectorie but not files in a parameter root directory)
echo The parameter root directory is e.g. c:\temp in 'ru 10 "c:\temp"'
echo Usage: ru size "directory"
echo           size...Mark directories exceeding the size in MB with character!
echo                directory...Directory or drive to be evaluated
echo Example: ru 1000 "h:\users"
echo This program can be run in 2 modes: interactive (ru.bat) or
echo one time (e.g. ru 10 "c:\temp" "c:\temp\results.txt") with results output
echo to a file
echo -----------------------------------------------------------------------
rem echo first ruopen= %ruopen%
if "%ruopen%"=="Yes" goto konec
set ruopen=Yes
rem echo second ruopen= %ruopen%
cmd
:exitcmd
exit
goto exitcmd
:konec
=========================================

Save the file and the you can run it as ru.bat (doubleclick, command line etc.)
0
 
Tacobell2000Author Commented:
Hello Znalost,

I copied and pasted the above script in a txt file and renamed it to a .bat file. Put it on the file server in question and double clicked the bat file. The out put is as follows:

This program lists directory sizes (including subdirectories and
files in the subdirectorie but not files in a parameter root directory)
The parameter root directory is e.g. c:\temp in 'ru 10 "c:\temp"'
Usage: ru size "directory"
          size...Mark directories exceeding the size in MB with character!
               directory...Directory or drive to be evaluated
Example: ru 1000 "j:\montreal"
This program can be run in 2 modes: interactive (ru.bat) or
one time (e.g. ru 10 "c:\temp" "c:\temp\results.txt") with results output
to a file
-----------------------------------------------------------------------
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

There are no results showing. I know i am doing this wrong can you please let me know how to get it right.

Many thnaks,
Tacobell2000
0
 
ZnalostCommented:
Hi Tacobell2000,
As the message says, if you want to see resutls for example for j:\montreal directory and mark all sub-directories exceeding 400 MB, you have to type at the command prompt following:
ru 400 "j:\montreal"
Output will be genarated in few seconds or minutes in your command shell window. It will enumarate all sub-directories of j:\montreal but not files located directly under j:\montreal.

Good luck
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now