Solved

Help with Script

Posted on 2006-07-10
3
183 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
  • 2
3 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 444 total points
Comment Utility
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
Comment Utility
bruintje thanks a bunch!
0
 
LVL 44

Expert Comment

by:bruintje
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…

744 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

16 Experts available now in Live!

Get 1:1 Help Now