effem Posted February 23, 2007 Share Posted February 23, 2007 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. Quote Link to comment Share on other sites More sharing options...
remkow Posted February 24, 2007 Share Posted February 24, 2007 You want to eject an USB key? lol Quote Link to comment Share on other sites More sharing options...
effem Posted February 26, 2007 Author Share Posted February 26, 2007 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". Quote Link to comment Share on other sites More sharing options...
remkow Posted February 26, 2007 Share Posted February 26, 2007 You can do this with most new sticks anyways, but some USB sticks will screw up when you just take them out. Solution has been given by Irongeek in this topic: http://www.hak5.org/forums/viewtopic.php?t=5416 just read it through, and you'll find it. Quote Link to comment Share on other sites More sharing options...
effem Posted February 26, 2007 Author Share Posted February 26, 2007 Hm. Read the whole thread. That one is about performance. I couldn't find any info on safe removal. Am I overlooking something here? If so, please post the relevant snippet here (and I'll promise I'll have my glasses checked). Quote Link to comment Share on other sites More sharing options...
remkow Posted February 26, 2007 Share Posted February 26, 2007 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 Quote Link to comment Share on other sites More sharing options...
effem Posted February 26, 2007 Author Share Posted February 26, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.