Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Vbscript


  • Please log in to reply
No replies to this topic

#1 RandomUser

RandomUser

  • Members
  • 518 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:02:37 AM

Posted 13 August 2008 - 07:45 PM

I've learned how to create a simple script by reading and looking at code,
that echoes anything I want from the classes listed in the Topic Description.

So, in an attempt to better understand my options, Would someone tell me
of other methods to get this information. Below is what I've come up with.

If at all possible, please stick with VBScript. The script is below, and know that
I don't want someone to write a script for me, ney, tell me another method that
works, and I'll try it to see if I can learn something.

Option Explicit
'On Error Resume Next
Dim strComputer
Dim objWMIService
Dim colItems
Dim objItem

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * from Win32_CDROMDrive")

For Each objItem in colItems
WScript.Echo "Drive: " & objItem.ID
WScript.Echo "Manufactuer:" & objItem.Manufacturer
next


I know it's basic in Scripting and Programming terms, but if one is to be proficient,
better to understand many solutions and problems.

Thanks in advance for any suggestions.

BC AdBot (Login to Remove)

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users