ASP 101 - Active Server Pages 101 - Web03
The Place ASP Developers Go!



Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash



 Top ASP 101 Stories Top ASP 101 Stories
Connections, Commands, And Procedures
What is ASP?
VBScript Classes: Part 1 of N

QUICK TIP:
Autofix IIS Failures
Show All Tips >>
ASP 101 RSS Feed ASP 101 Updates


Quick Tips


Keeping an Eye on Free Disk Space

With the size and cost of hard drives these days this probably isn't as big a deal as it used to be, but there are still times when your server might fill up it's hard drive. This happened to me the other day and it caught me totally off guard. So I whipped up this little script to help me keep an eye on things.

<%
Dim objFSO
Dim objDrive
Set objFSO   = Server.CreateObject("Scripting.FileSystemObject")
Set objDrive = objFSO.GetDrive("C:")
Response.Write "<pre>" & vbCrLf
Response.Write "Drive Letter: "
Response.Write objDrive.DriveLetter
Response.Write vbCrLf
Response.Write "Volume Name:  "
Response.Write objDrive.VolumeName
Response.Write vbCrLf
Response.Write "Free Space:   "
Response.Write FormatNumber(objDrive.FreeSpace, 0) & " bytes"
Response.Write vbCrLf
Response.Write "Total Size:   "
Response.Write FormatNumber(objDrive.TotalSize, 0) & " bytes"
Response.Write vbCrLf
Response.Write "Percent Free Space: "
Response.Write FormatPercent(objDrive.FreeSpace / objDrive.TotalSize)
Response.Write vbCrLf
Response.Write "</pre>" & vbCrLf
Set objDrive = Nothing
Set objFSO = Nothing
%>

For most sites storage isn't a big deal. Web files tend to be relatively small and storage isn't usually a problem, but if you're hosting somewhere with a storage limit or your site allows users to upload files you could be out of space before you know it... at least now you can easily check.


Previous      Show All Tips      Next

If you have a tip you would like to submit, please send it to: webmaster@asp101.com.


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers