Welcome to ServerForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Newbie - Available Disk Space

 
   Windows Server (Home) -> Windows Server Scripting RSS
Next:  Environment Variable  
Author Message
Giuliano Camarini de Oliv

External


Since: Nov 10, 2003
Posts: 2



(Msg. 1) Posted: Mon Nov 10, 2003 3:54 pm
Post subject: Newbie - Available Disk Space
Archived from groups: microsoft>public>windows>server>scripting (more info?)

Sorry for the question, but i'm really newbie in this
stuff.

How can I get the remote available disks space divided by
partition or volume?

Tks in advance,
Giuliano

 >> Stay informed about: Newbie - Available Disk Space 
Back to top
Login to vote
Giuliano Camarini de Oliv

External


Since: Nov 10, 2003
Posts: 2



(Msg. 2) Posted: Mon Nov 10, 2003 4:45 pm
Post subject: Newbie - Available Disk Space [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

If possible, I'd like the results in a file output...

Tks,
Giuliano


>-----Original Message-----
>Sorry for the question, but i'm really newbie in this
>stuff.
>
>How can I get the remote available disks space divided by
>partition or volume?
>
>Tks in advance,
>Giuliano
>.
>

 >> Stay informed about: Newbie - Available Disk Space 
Back to top
Login to vote
ski

External


Since: Oct 21, 2003
Posts: 13



(Msg. 3) Posted: Wed Nov 12, 2003 3:58 pm
Post subject: Re: Newbie - Available Disk Space [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

This should get you started.

Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const HARD_DISK = 3
Set objDictionary = CreateObject("Scripting.Dictionary")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set LogFile2 = objFSO.OpenTextFile("c:\driveinfo.txt", ForAppending, True)

Computer = inputbox("Name of the system you want to check for remaining disk
space.","System Name")

LogFile2.WriteLine "----------------------------------------" & vbcrlf &
vbtab & "** " & _
Ucase(Computer) & " **"
Set disks = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
Computer & _
"\root\cimv2").InstancesOf ("Win32_LogicalDisk")

for each disk in disks
if disk.drivetype = "3" then
outstr = "Drive(" & disk.name & ")" & vbtab & "File System: " &
disk.filesystem & vbcrlf & _
"Size: " & round(disk.size/1073741824, 2) & " GB" & vbtab & "Free: " &
_
round(disk.freespace/1073741824, 2) & " GB" & vbcrlf & "Percent Free: "
& round(disk.freespace/disk.size * 100, 2) & "%"
LogFile2.WriteLine outstr & vbcrlf
end if
next



"Giuliano Camarini de Oliveira" <gcoliveira.TakeThisOut@rocketmail.com> wrote in message
news:039201c3a7ed$116475b0$a601280a@phx.gbl...
> If possible, I'd like the results in a file output...
>
> Tks,
> Giuliano
>
>
> >-----Original Message-----
> >Sorry for the question, but i'm really newbie in this
> >stuff.
> >
> >How can I get the remote available disks space divided by
> >partition or volume?
> >
> >Tks in advance,
> >Giuliano
> >.
> >
 >> Stay informed about: Newbie - Available Disk Space 
Back to top
Login to vote
TC

External


Since: Nov 13, 2003
Posts: 2



(Msg. 4) Posted: Thu Nov 13, 2003 8:11 am
Post subject: Re: Newbie - Available Disk Space [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I get an automation error on the statement:

Set disks = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
Computer & _
"\root\cimv2").InstancesOf ("Win32_LogicalDisk")

Is this looking for a \root\cimv2 share?
 >> Stay informed about: Newbie - Available Disk Space 
Back to top
Login to vote
ski

External


Since: Oct 21, 2003
Posts: 13



(Msg. 5) Posted: Thu Nov 13, 2003 11:12 am
Post subject: Re: Newbie - Available Disk Space [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

What is the exact error? What operating systems are involved? This script
runs fine for me on a Win2K machine getting info on other Win2K machines and
XP machines. No, \root\cimv2 is just a WMI namespace.

"TC" <anonymous.DeleteThis@discussions.microsoft.com> wrote in message
news:2D60C5FD-4485-4371-B508-8D5E38FCA7B9@microsoft.com...
> I get an automation error on the statement:
>
> Set disks = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
> Computer & _
> "\root\cimv2").InstancesOf ("Win32_LogicalDisk")
>
> Is this looking for a \root\cimv2 share?
 >> Stay informed about: Newbie - Available Disk Space 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Simple Disk Space Script - Ok using the simple script below I can look at the disk space on my local machine. However if I change the strComputer name to a remote machine I get an error diskspace2.vbs(2, 1) Microsoft VBScript runtime error: Permission denied: 'GetObject' I..

Newbie HELP! - Hello all, I am fairly new to VBSCRIPTING, I have searched the web for information on how to go about accomplishing the following: 1. List all users currenlty logged onto the server (w2k member server or dc) 2. Found a utility Psloggedon.exe that..

newbie vbscript Q: - I have just started to make a login script. I want the script to check who has logged in and then use the login name. How do I do that? Thanx

Newbie - need tips for creating logon scripts - I'm new to this Win Server 2003 business having just installed it on our small office network of WinXP and Win98 PC's. What I want to do is create a logon script which will map two networked drives, and map the two printers we have. The drives are..

Newbie: Find who scheduled task is running as - I have a WMI script (VB) that connects to a list of systems and gives me all of the services on each machine that are not running as "LocalSystem". I would like for the same script to also give me all of the scheduled tasks on those servers th...
   Windows Server (Home) -> Windows Server Scripting All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can 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



[ Contact us | Terms of Service/Privacy Policy ]