Hi, I want to know how can I eject a removable device. The device is assumed to be a USB memory stick and comes on a E drive so therefore I would like to safely remove the E drive when the user log off! The code for log off is as follows

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbAppWindows Then ' // Windows Is Shutting Down
' //
Cont = MsgBox(" Windows Is Shutting down! Good Bye?", vbYesNo)
If Cont = vbYes Then

I need to safely eject the E drive here can any one help thanks in advance

Recommended Answers

All 2 Replies

Hi, thanks for the link the code in there is in C is there a code in Visual basic to do the same thing. thaks

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.