turtle342 0 Posted July 3, 2013 Hey guys, I've been using AutoIT for a few months now, mainly for automating some disk drive tests. My question is I'm struggling to find a way to Enable and Disable hardware, mainly a SCSI drive, to perform some benchmarking. I've used WMIC a fair amount in my scripting so far but from what I've found out, disabling hardware doesn't fall under WMIC scope This may have been asked a fair few times, and no I don't need automation to install drivers for me, just Disable / Enable the drive, possible uninstall and reinstall (without removal of drivers) and also Online/Offline the drive. Anyone got any experience in this area?? Cheers, Martin Share this post Link to post Share on other sites
turtle342 0 Posted July 3, 2013 Ok, I've found out we can do Online / Offline using DiskPart, so thats at least one step covered! Any thoughts on Disable/Enable and Uninstall/Reinstall welcome! Share this post Link to post Share on other sites
JLogan3o13 1,513 Posted July 3, 2013 I have only seen this done using Devcon. http://support.microsoft.com/kb/311272 Hide JLogan3o13's signature Hide all signatures √-1 2^3 ∑ π, and it was delicious! How to get your question answered on this forum! Share this post Link to post Share on other sites
AZJIO 140 Posted July 3, 2013 Func _RemoveLetter($sDrive) $sPath = @TempDir & '\dismount_hdd.txt' $hFile = FileOpen($sPath, 2) FileWrite($hFile, 'select volume ' & $sDrive & @CRLF & 'remove letter=' & $sDrive) FileClose($hFile) RunWait(@SystemDir & '\DiskPart /s ' & $sPath, '', @SW_HIDE) EndFunc ;==>_RemoveLetter Hide AZJIO's signature Hide all signatures My other projects or all Share this post Link to post Share on other sites
turtle342 0 Posted July 3, 2013 Func _RemoveLetter($sDrive) $sPath = @TempDir & '\dismount_hdd.txt' $hFile = FileOpen($sPath, 2) FileWrite($hFile, 'select volume ' & $sDrive & @CRLF & 'remove letter=' & $sDrive) FileClose($hFile) RunWait(@SystemDir & '\DiskPart /s ' & $sPath, '', @SW_HIDE) EndFunc ;==>_RemoveLetter This will remove the drive letter but not Disable the device, or Uninstall it! And I'll look into this! Cheers JLogan! Share this post Link to post Share on other sites
AZJIO 140 Posted July 3, 2013 (edited) This will remove the drive letter but not Disable the device, or Uninstall it! What do you want? Power to the device is turned on and the disc is still spinning. Device_off_on Edited July 3, 2013 by AZJIO Hide AZJIO's signature Hide all signatures My other projects or all Share this post Link to post Share on other sites
turtle342 0 Posted July 3, 2013 Maybe you mis-understand, I need to automate disabling the device as you would via Device manager, so I can check enumeration and duration (amongst other things) when it's enabled again, I will check out Device_off_on (whatever it is) when I'm back at home! Share this post Link to post Share on other sites