Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 To: rino tenorio
  Where is rino tenorio?
 pasig
 Philippines
 rino tenorio
 Tags
Subject: RE: how to read the harddisk serial
Thread ID: 197716 Message ID: 197723 # Views: 43 # Ratings: 0
Version: Visual FoxPro 5 Category: Linux and VFP
Date: Monday, October 06, 2008 7:18:46 AM         
   


> >
> >
> > 
> > LOCAL strComputer, objWMIService, colItems, objItem
> > CLEAR
> > strComputer = "."
> > objWMIService = GetObject("winmgmts:\\" + strComputer + "\root\cimv2")
> > colItems = objWMIService.ExecQuery("Select * from Win32_DiskDrive",,48)
> > For Each objItem in colItems
> > 	? "PNPDeviceID: " + objItem.PNPDeviceID   &&Harddisk ID
> >         ? "Size: " + objItem.Size   &&Harddisk Size its also unique.
> >  NEXT
> > 
> > 
> > 
> > 
> > 

> >
> > Anil
> > My Blog
>
> Thanks Anil but if the computer has 2 or more harddisk how will i know is the main harddisk?

What do you mean by main harddisk? Being the primary master harddisk or the one that contains the OS? If so, then you can use GETENV("windir").

One more thing, your category says Linux, i am not sure those commands will run there?

Jun Tangunan
http://weblogs.foxite.com/sandstorm36/



COMPLETE THREAD
how to read the harddisk serial Posted by rino tenorio @ 10/6/2008 6:25:16 AM
RE: how to read the harddisk serial Posted by Anil Sharma @ 10/6/2008 6:34:47 AM
RE: how to read the harddisk serial Posted by rino tenorio @ 10/6/2008 7:09:32 AM
RE: how to read the harddisk serial Posted by rino tenorio @ 10/6/2008 7:09:33 AM
RE: how to read the harddisk serial Posted by Jun Tangunan @ 10/6/2008 7:18:46 AM
RE: how to read the harddisk serial Posted by Anil Sharma @ 10/6/2008 7:38:37 AM
RE: how to read the harddisk serial Posted by Anup Singh @ 10/6/2008 9:27:12 AM