?
Solved

Help with Script

Posted on 2006-07-10
3
Medium Priority
?
191 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 1776 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month10 days, 8 hours left to enroll

765 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