turtle342 Posted July 3, 2013 Share 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 Link to comment Share on other sites More sharing options...
turtle342 Posted July 3, 2013 Author Share 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! Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 3, 2013 Moderators Share Posted July 3, 2013 I have only seen this done using Devcon. http://support.microsoft.com/kb/311272 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
AZJIO Posted July 3, 2013 Share 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 My other projects or all Link to comment Share on other sites More sharing options...
turtle342 Posted July 3, 2013 Author Share 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! Link to comment Share on other sites More sharing options...
AZJIO Posted July 3, 2013 Share 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 My other projects or all Link to comment Share on other sites More sharing options...
turtle342 Posted July 3, 2013 Author Share 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! 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