Well, this is an unmatched double quote:
Code:
$DriveDefinition=Ltrim(Rtrim(SubStr($DriveDefinition,InStr($DriveDefinition,")+1)))



The code that you've posted is very broken. That line should look something more like:
Code:
$DriveDefinition=Ltrim(Rtrim(SubStr($DriveDefinition,InStr($DriveDefinition,' ')+1)))



Please post your entire code again, but this time make sure that you post it inside CODE tags. If you don't it will make it very hard for us to debug.