Jump to content

USB eject


effem

Recommended Posts

Hi,

Got my U3 disk yesterday, and managed to get my own image on it, thanks to this site.

Thanks alot for that!

However, I am encountering one problem. I want to eject the usb stick from within the program that I am starting. However apparently when the program is launched from the CD part, it still keeps the disk open and it cannot be ejected.

I do have code to eject the disk and that runs nicely if I run the prog from hard disk, but not from USB.

I noticed though that the U3 software has an eject button and that they apparently do manage.

Any idea what would be the best way to achieve this (preferably without installing anything on the local PC).

Thanks,

FM.

Link to comment
Share on other sites

Maybe I misphrased myself.

I want to put the usb subsystem in such a state that I can remove the disk without XP complaining about it (and that all files are properly flushed etc).

Basically I want to do in software what I normally do with an USB flash disk with the tray icon.

In the U3 launchpad this function is called "eject".

Link to comment
Share on other sites

Like I said, read the whole page:

A few more findings:

1. I thought that my Symantec AV may be the problem, but after removal it made no difference.

2. Read and writes are much faster under Linux than under Vista/XP.

3. It's faster in Vista to mount a Trucrypt volume off the thumbdrive, then run your apps off of it then it is to run the app straight off of the thumbdrive.

4. Changing the device options in control panel from the default "Optimize for removal" to "Optimize for performance".

the bold thing is ur answer

Link to comment
Share on other sites

Ehm. I think this is just a change in settings to increase the performance.

That is not what I want. I want to be able to sync all files, flush them to the disk and unmount the disk (or eject or remove whatever word you want to use)

Just like you do with the tray icon (but I want to do it from software).

And when I pull the stick I do not want to get an error message about removing a drive without removing it.

The U3 control center contains such a function, but I can't find how to do it from my program.

Closest I came was this: http://www.codeproject.com/system/RemoveDriveByLetter.asp

However that does not work if you run your exe from the iso.

A copy would help, but I was hoping for a more elegant solution.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...