> >
> >
> >
> > 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/