Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


combine Win32_DiskDrive & Win32_LogicalDisk

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,50124
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> combine Win32_DiskDrive & Win32_LogicalDisk
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 combine Win32_DiskDrive & Win32_LogicalDisk - 7/30/2007 12:15:43 AM   
  chapeau_melon

 

Posts: 17
Score: 0
Joined: 6/20/2007
Status: offline
 Hello,

I'd like to combine combine Win32_DiskDrive  & Win32_LogicalDisk.

But it seems not to works. The logicaldisk still goes back to the 'whole' machine. 

First I'd like to select only the USB drive and from only these drive I'd like to have the drive letter.

Knowing that I have no admin rights on my machine !!!

strComputer = "." 
  Set objWMI = GetObject("winmgmts:" _
      & "{impersonationLevel=impersonate}!\\" & strComputer _
           & "\root\cimv2")
  Set colDiskDrives = objWMI.ExecQuery _
      ("Select DeviceID from Win32_DiskDrive WHERE InterfaceType='USB'")
  For Each objDiskDrive In colDiskDrives
           strDeviceID = objDiskDrive.DeviceID    
           wscript.echo strdeviceID

           Set colDisks = objWMI.ExecQuery ("Select Name from Win32_LogicalDisk Where DriveType=2 And VolumeName='MERLIN'") 
           For each objDisk in colDisks
             Merlindr = objDisk.Name 
           wscript.echo Merlindr
           next

Next
 
 
Post #: 1
 
 RE: combine Win32_DiskDrive & Win32_LogicalDisk - 7/31/2007 12:28:40 PM   
  dm_4ever


Posts: 2663
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Have you tried using wbemtest to look at the instances and values? Seems this same question has been discussed and everyone but you is able to detect USB drives.  Have you tried a different workstation?

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to chapeau_melon)
 
 
Post #: 2
 
 RE: combine Win32_DiskDrive & Win32_LogicalDisk - 7/31/2007 4:12:04 PM   
  chapeau_melon

 

Posts: 17
Score: 0
Joined: 6/20/2007
Status: offline
Hello,

I have no experience with wbemtest. can you help me using it ? What do I need to do once I'm inside ?

Also, keep in mind, that I'm running a machine without ADMIN rights !.

Kind regards,

Hear you soon

(in reply to dm_4ever)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> combine Win32_DiskDrive & Win32_LogicalDisk Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts