How to use Shell.Application to eject a USB device on Windows XP?

Viewed 136

I'm new to coding and I have never used Visual Basic before.

I was asked to write a script that ejects the USB drive.

Public sub cmdClose_Click()
    'CreateObject("Shell.Application").NameSpace("E:").Self.InvokeVerb "Eject"
End Sub

The above script that I found works on Windows 7 but not on XP.
If someone could give me an example of how to eject on Windows XP, that would be great.

0 Answers
Related