 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
hem2008
Joined: 27 May 2008 Posts: 1 Country: Congo, The Democratic Republic of The |
|
Determine the free space on a disk |
|
Hi,
I would like to create a job that will return the following infos :
- free diskspace
- used diskspace
- total diskspace
I know how to get the first info but don't know how to do the remaining ones.
Thank you for your assistance.
Hem
|
|
Tue May 27, 2008 5:00 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
You have several options. One way is to use a JAL script job and basically from a script run DOS dir command and parse the output, or use a VBScript job and use Drive object to get total and free disk space, for example,
 |
 |
Set fso = CreateObject("Scripting.FileSystemObject")
Set oDrive = fso.GetDrive("C")
curSpace = oDrive.FreeSpace
totSize = oDrive.TotalSize
curUsage = curSpace/totSize
curFree = 1 - curUsage
MsgBox "Current free space: " & FormatNumber(oDrive.FreeSpace,0) & vbLf & _
"Total size: " & FormatNumber(oDrive.TotalSize,0) & vbLf & _
"Current usage(%): " & FormatPercent(curUsage, 2) & vbLf & _
"Current free(%): " & FormatPercent(curFree, 2) |
For more details, see VBScript manual provided with 24x7, look for Drive object and its methods
|
|
Tue May 27, 2008 8:51 am |
|
 |
barefootguru
Joined: 10 Aug 2007 Posts: 195
|
|
|
|
If you're running on a Unix-based system you can use:
 |
 |
df -k |
If you're running under Windows powershell is an option:
 |
 |
powershell get-wmiobject -class win32_logicaldisk |
|
|
Mon Jun 30, 2008 10:12 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|