The script I'm creating is to output the % disk space usage on some servers. I know there is lots of programs which do this, but I want a script to run everyday and output it to a text file or something so management can look at it and so that it's completely automated. I also wanted to be able to do it in a batch file so I can fix/amend etc when necessary.
I was going to do it like this:
Use dir /-c to get the free disk space
Use diruse to get the used space
Then add them together
Then divide used space by total space and times by 100 = 25%
I know by default dir outputs the free space like you mentioned, and diruse can output it in bytes/KB/MB, but couldn't figure out how to do the calculations with the comers in it!
Hope this helps!
Thanks
Main Topics
Browse All Topics





by: GuruGaryPosted on 2006-10-04 at 13:47:23ID: 17663341
The command prompt SET command uses 32 bit integers. So you can use numbers up to 4 GB or 4,294,967,295. If you want something bigger than that, you will probably have to use a 3rd party program ... unless you want to split the number up, do math on the parts, and then combine the parts as text.
What exactly are you trying to do? Maybe we can help come up with a better solution?