A script I have that checks if an external HDD is connected, which has a prompt to mount the drive, with the option 'retry' and 'cancel'. If I click 'retry' it says it has found the drive, even though it's not connected, how can I fix this ?
Siberian 13 Junior Poster
Recommended Answers
Jump to Postshow the code you're using.
Jump to PostTry this
const DRIVE = "F" set fso = CreateObject("Scripting.FileSystemObject") On Error Resume Next Do set drv = fso.Drives(DRIVE) if err.Number = 0 then Exit Do If MsgBox("Drive " & DRIVE & ": is not available, Please mount the drive", vbRetryCancel, "Test") = vbCancel Then Wscript.Quit End …
Jump to PostI tried it on my computer (Windows 7 Pro). I have an external hard drive assigned to F. I run the script and click on Retry a couple of times before plugging in the drive. Then I click on Retry until the drive is recognized. No crashes.
All 12 Replies
tinstaafl 1,176 Posting Maven
Siberian 13 Junior Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Siberian 13 Junior Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Siberian 13 Junior Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Siberian 13 Junior Poster
Siberian 13 Junior Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Siberian 13 Junior Poster
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.