Hi guys

I'm currently writing a program which has a requirement to reassign drive letters if a drive with a particular volume name is plugged in to ensure that it is assigned to the correct drive letter.

Now, I've managed to build some code for checking which drive letters are free. However I've not had much luck with actual drive letter reassignment and google has let me down ().

One way to do this would be to have the program write a script file which does it and then launch that in conjunction with diskpart... but that's a bit messy and I'd prefer to do it with code.

Any ideas?

[EDIT] Maybe another way is to force-eject a drive (after checking to see if it is removable and with the user permission).. but again I'm not sure how to do this.