I am trying to set up a backup job. I have a USB drive plugged into a remote IP PDU. The drive stays powered off. When the backup job starts, it will run a script that turns the power on and mounts the USB drive. I need to make sure the drive is mounted and ready to use before writing to it.
When the backup is finished, another script is ran that ejects the USB drive and turns the power off.
So I'm trying to figure out the best way to accomplish this.
Below is what I've come up with so far but it doesn't check for "(safely removed)" or "(disabled)":
Code: Select all
usr.exe list -s | findstr %drvMdl%
if %errorlevel% == 0 (
) else (
After testing with three different HDD enclosures/docking stations, only one of them populated the list with the HDD model #. The others populate the list with:
1. Dual Drive Dock 1 SCSI Disk Device (D:)
2. Avastor HDX Pro SCSI Disk Device (F:)