possy_99 Posted January 11, 2007 Share Posted January 11, 2007 I'm writing a small script to backup my favorites etc, I am planning to scan for second hard disks or removable media and having the option to select any resulting drives as a backup destination. here's an example... $ddrive = DriveStatus ( "d:" ) If $ddrive="READY" then $drivetype = DriveGetType( "d:\" ) If $drivetype="FIXED" then ?????? EndIf the problem is though, I want to aviod partitions on the primary hard disk which will get wiped when reinstalling my os, so in some cases D will be a partition, and not a good place to keep a backup. is there any way to differentiate physical disks, ie... HD0,HD1 to avoid partitions? Link to comment Share on other sites More sharing options...
Wooltown Posted January 11, 2007 Share Posted January 11, 2007 Use DriveGetDrive, see helpfile and scan for "Fixed". Link to comment Share on other sites More sharing options...
Joon Posted January 11, 2007 Share Posted January 11, 2007 This will get you started. $objWMIService = ObjGet("winmgmts:\\.\root\CIMV2") $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_LogicalDiskToPartition") For $objItem in $colItems MsgBox(0,"",StringMid($objItem.Dependent,StringLen($objItem.Dependent)-2,1) & " drive is on " & _ StringMid($objItem.Antecedent,StringInStr($objItem.Antecedent,"=")+2,7) & ".") Next Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now