SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Determine the free space on a disk

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Determine the free space on a disk
Author Message
hem2008



Joined: 27 May 2008
Posts: 1
Country: Congo, The Democratic Republic of The

Post Determine the free space on a disk Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7842

Post Reply with quote
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,

Code:
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 View user's profile Send private message
barefootguru



Joined: 10 Aug 2007
Posts: 195

Post Reply with quote
If you're running on a Unix-based system you can use:

Code:
df -k


If you're running under Windows powershell is an option:

Code:
powershell get-wmiobject -class win32_logicaldisk

Mon Jun 30, 2008 10:12 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.