Jump to content
Sign in to follow this  

How to eject a sd-card

Recommended Posts

Hello to all,

I've written a little program with autoit which calls during running coded dates from a sd-card to sign in to special folders in my home network.

On the end of the program it checks if the sd-card is still inserted. If yes, I get a message to remove it. Now I have always to click on the USB-Icon in systray to eject and remove the card properly.

My wish is to integrate a function to do this in my little program so I can remove the card without any probs. I was looking around for a solution but couldn't find once. Oh, I don't want to use an external program like 'ejectmedia.exe' or anything like that.

Is somebody there with a idea?

Please excuse my bad English but I'm a German and did my realy very best.


Edited by HalleMike

Share this post

Link to post
Share on other sites

You will want to look at Diskpart for command line: http://technet.microsoft.com/en-us/library/bb490893.aspx    Or Drivetools: http://www.uwe-sieber.de/drivetools_e.html

For Diskpart do:

  1. Type diskpart and wait for the diskpart prompt (DISKPART>)

  2. Type list volume

  3. Note the volume number of the SD drive carefully (use listed properties such as drive letter, label, type and size for help)

  4. Type select volume <number>, where <number> is the volume number noted above


  5. Type remove all dismount

  6. Type exit to quit Diskpart

If that works, then you should be able to script this using the run command ( I would absolutely certain that the SD card is the same volume EVERY time, aka this approach isn't a good idea if you or others will be plugging or unplugging other devices into your system/mounting other drives/mapping new drives while attempting this)

Edited by Wombat

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner

The internet is our one and only hope at a truly free world, do not let them take it from us...

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...