This question already has an answer here:
- Remove USB device from command line 4 answers
I would like to be able to programmatically safely remove a USB drive, given a drive letter. This is actually to be implemented in an application, but I figured that if it can be done using a batch script, I can easily transfer it to code.
The only twist is that I do not want to include any third party applications or anything, so if anyone can show me how to use
diskpart or anything alternative I would be grateful.