Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Free space of folders on a mapped network drive

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,64007
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Free space of folders on a mapped network drive
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Free space of folders on a mapped network drive - 9/3/2008 8:08:57 AM   
  nol


Posts: 5
Score: 0
Joined: 9/2/2008
Status: offline
Dear all,
I have a several mapped network drives... In those drivers I have a few folders that I would like know the free space.
Can anyone help me with some code to get this information?
Thanks in advance!
 
 
Post #: 1
 
 RE: Free space of folders on a mapped network drive - 9/3/2008 10:55:22 AM   
  DiGiTAL.SkReAM


Posts: 1184
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Do a search.
Why should we take the time to help when you won't take the time to search?

_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to nol)
 
 
Post #: 2
 
 RE: Free space of folders on a mapped network drive - 9/7/2008 9:22:08 PM   
  nol


Posts: 5
Score: 0
Joined: 9/2/2008
Status: offline
Hi,

I have the following script but...

NetworkDrive = "G:\TEST"
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & NetworkDrive & "\root\cimv2")
Set colDiskDrives = objWMIService.ExecQuery ("Select * from Win32_PerfFormattedData_PerfDisk_LogicalDisk Where " & "Name <> '_Total'")
For Each objDiskDrive in colDiskDrives
   Wscript.Echo "Drive Name: " & objDiskDrive.Name
   Wscript.Echo "Free Space: " & objDiskDrive.FreeMegabytes
Next

... appears the following message:
"The remote server machine does not exist or is unavailable: GetObject"

How can I solve this?
Thanks!


(in reply to nol)
 
 
Post #: 3
 
 RE: Free space of folders on a mapped network drive - 9/8/2008 1:28:41 AM   
  chiltz

 

Posts: 76
Score: 0
Joined: 6/13/2007
Status: offline
Below is the way I would do it.


      

You can expand on that by giving user interacvtive variables for the folder to check.  You could also provide a UNC path, have it map to a network drive, get the space info, and then unmap the network drive.

(in reply to nol)
 
 
Post #: 4
 
 RE: Free space of folders on a mapped network drive - 9/8/2008 2:36:10 AM   
  nol


Posts: 5
Score: 0
Joined: 9/2/2008
Status: offline
Dear chiltz,
Thanks for your answer and sample...

When I try to run your script appears the following message: "Object doesnīt support this property or method:"FreeSpace"...
Itīs possible to do it in another way?
Thanks

(in reply to chiltz)
 
 
Post #: 5
 
 RE: Free space of folders on a mapped network drive - 9/8/2008 4:36:42 AM   
  chiltz

 

Posts: 76
Score: 0
Joined: 6/13/2007
Status: offline
doesn't like the folder after the G:\.  The below would also work.



      

or


      

Or  (and the 1 I would use)


      

< Message edited by chiltz -- 9/8/2008 4:38:59 AM >

(in reply to nol)
 
 
Post #: 6
 
 RE: Free space of folders on a mapped network drive - 9/8/2008 4:54:20 AM   
  dm_4ever


Posts: 2669
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
quote:

ORIGINAL: nol

Dear all,
I have a several mapped network drives... In those drivers I have a few folders that I would like know the free space.
Can anyone help me with some code to get this information?
Thanks in advance!



one thing to keep in mind....if you're trying to get the free space of a folder you are mapping to and it has quotas enabled....it may not necessarily show you the free space remaining for your quota but the entire free space for the disk that that folder resides in.....Windows 2003 R2 has better control of quotas and may display properly...though I haven't tried yet.

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to nol)
 
 
Post #: 7
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Free space of folders on a mapped network drive Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts