Hi, I'm new to this, and I'm a bit stumped on this. I'm trying to use autoit to check devices for a battery, unfortunatley, when I run this on a computer that doesn't have a battery, it spits out the following: AutoIT Error Line -1: Error: Variable must be of the type "Object". How can I avoid/hide this error when the script runs against devices without a battery? When the code is executed on a device with a battery, it functions fine. The code: Dim $sAns $WMI = ObjGet("WinMgmts:") $objs = $WMI.InstancesOf("Win32_Battery") $iCount = 1 For $obj In $objs $sAns = $sAns & $obj.Caption If $iCount < $objs.Count Then $sAns = $sAns & "," $iCount += 1 Next If $obj.Caption <> 'Internal Battery' Then Msgbox(0,"Yay","It works!") If anyone can help, I'd appreciate it