[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 193
  • Last Modified:

Help with Script

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
veedar
Asked:
veedar
  • 2
1 Solution
 
bruintjeCommented:
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
 
veedarAuthor Commented:
bruintje thanks a bunch!
0
 
bruintjeCommented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now