Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This question already has an answer here:

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?

share|improve this question

marked as duplicate by iglvzx, Keltari, Simon, Tog, afrazier Apr 24 '13 at 13:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

1 Answer

up vote 0 down vote accepted

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.

share|improve this answer
    
Wow, I'm surprised this isn't possible without external software. I would rather just pull the card than have to go to all this trouble. –  Michael Apr 24 '13 at 5:07
    
just be sure to enable "quick removal" so you dont corrupt your data –  Keltari Apr 24 '13 at 5:15
    
i'll make sure that's enabled. however, it should be safe anyway if i'm not writing the drive, right? i'm basically just running an asset import script which only reads data off the device. –  Michael Apr 24 '13 at 5:17
    
If you arent writing to the drive, in theory the cache doesnt need to be flushed... but you never know... better safe than sorry, right? –  Keltari Apr 24 '13 at 5:19
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.