myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


  


win32_diskDrive - how to tell which drive is which?

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Scripting Technologies] >> Windows Management Instrumentation >> win32_diskDrive - how to tell which drive is which? Page: [1]
Login
Message << Older Topic   Newer Topic >>
win32_diskDrive - how to tell which drive is which? - 8/8/2008 4:37:39 PM   
dcopenhaver

 

Posts: 18
Score: 0
Joined: 8/1/2008
Status: offline
I need to use a wmi query to get the size of a hard drive and branch some logic based on it... this part is no problem. However my script needs to work when there is more than one hard drive present...

I was thinking I could use the index property but I would need to know how windows decides to assign this property to the drives?

eg. say there will always be 2 or more volumes, one for the OS to be installed on, and the others for data. I need to be sure I'm working with the one that the OS is to be installed on. All of this will be taking place from within a winPE environment prior to OS installation. I was thinking that maybe the order in which the volumes are created via the raid controller may dictate the order that they are assigned the index value?

not even sure I'm asking this well... basically I need to be sure I'm working with the right drive, which will be the one to install the OS on, but I don't have any criteria that I can think of to assure this.
Post #: 1
RE: win32_diskDrive - how to tell which drive is which? - 8/27/2008 8:45:44 AM   
SAPIENScripter

 

Posts: 100
Score: 0
Joined: 5/15/2007
From: SAPIEN Technologies
Status: offline
You can write a WMI query to return just fixed local hard drives by using;

select * from win32_logicaldisk where drivetype=3

But won't you always install the OS to C:? If so, then use this query:  Select * from win32_logicaldisk where deviceid='c:'


_____________________________

Jeffery Hicks
Microsoft MVP - Windows PowerShell
http://blog.SAPIEN.com
coming soon: Managing Active Directory with Windows PowerShell: TFM
followme: http://www.twitter.com/jeffHicks

(in reply to dcopenhaver)
Post #: 2
Page:   [1]
All Forums >> [Scripting Technologies] >> Windows Management Instrumentation >> win32_diskDrive - how to tell which drive is which? 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



  
Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.578