1

I can eject a network drive using net use X: /DELETE but when I try to use this same command on removable media I get an error:

The network connection could not be found.

More help is available by typing NET HELPMSG 2250.

Yes, obviously it isn't a network connection, so how do I eject the device from a script?

Synetech
  • 69,547
Michael
  • 2,824

1 Answers1

2

There doesnt appear to be a built in Windows command to do this. There may be scripting functionality in VBScript or PowerShell, but I didnt see any.

However, you are not the only person to ask this. I found this in a quick Google search. Some C++ code to compile to give you a CLI command to eject media. Look at the first answer to the question for a link to the code.

Here is a precompiled program that does something similar.

Keltari
  • 75,447