Solved

Help with Script

Posted on 2006-07-10
3
189 Views
Last Modified: 2010-04-30
Hi,
I'm told this will report free space on my C drive...

Set objWMIService = GetObject("winmgmts:")
Set objLogicalDisk = objWMIService.Get("Win32_LogicalDisk.DeviceID='c:'")
Wscript.Echo objLogicalDisk.FreeSpace

...I need it spelled out to me how I can run this code from a DOS window?

Also I'm just getting into Windows scripting. is there any on-line resource you can suggest to help. Thanks!
0
Comment
Question by:veedar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 444 total points
ID: 17074431
Hi veedar,
----------

1. just open a notepad
2. paste your code

Set objWMIService = GetObject("winmgmts:")
Set objLogicalDisk = objWMIService.Get("Win32_LogicalDisk.DeviceID='c:'")
Wscript.Echo objLogicalDisk.FreeSpace

3. save it to c as test.vbs
4. open a command prompt
5. type c:\test.vbs
6. hit enter

it will popup the box with free space

personally i like the scripting guy columns on technet
http://www.microsoft.com/technet/scriptcenter/topics/beginner/firststeps.mspx

----------
bruintje
share what you know, learn what you don't
0
 
LVL 15

Author Comment

by:veedar
ID: 17074879
bruintje thanks a bunch!
0
 
LVL 44

Expert Comment

by:bruintje
ID: 17074929
you're welcome, thanks for the grade and the 1776 points

thats a curious date in history > http://en.wikipedia.org/wiki/1776

many valuable texts where published that year, at least those which we should take our cue from these days ;-)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

726 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