Jump to content

Disable/Enable Hardware (SCSI Drive)


Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...