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,883 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
Comment Utility
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
Comment Utility
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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This is about my first experience with programming Arduino.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now