Solved

Need a VBScript to check free disk space of a UNC path and return the results in GB

Posted on 2011-03-02
3
1,907 Views
Last Modified: 2012-05-11
Hello.  I need a VBscript (VBS) that will report back the free disk space (in gigabytes) of a UNC path I feed it.  I would execute the VBscript with a single argument and the argument would be the UNC path I would want to check free space.  The script would need to write the result, simply just the number, to the shell.  

For example this is how I would like to execute the vbscript:

myVBScheckDiskSpace.vbs \\server1\share

Here is an example result I am looking for:

17

I would be executing this VBScript at the command prompt.  I need this script in a quick hurry so I am assigning the maximum points.  I appreciate they help.

Thank You
0
Comment
Question by:far182
  • 2
3 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 35017812
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 35017841
if you have admin rights then u can do the following as well:

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("\\<machine>\C$\Scripts")
Wscript.Echo objFolder.Size/1000000000 ''-->convert to GigaBytes
0
 
LVL 1

Author Closing Comment

by:far182
ID: 35024029
While this didn't provide everything I was looking for, you gave me the missing things I needed to get this done.  Thank you.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will learn how to dynamically set the form action using jQuery.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question