OS2 World.Com Forum

Subject  :  Ejecting USB-devices
Author  :  melf
Date  :  09 Sep, 2005 on 14:17
To eject an USB device, like my storagedevice or my digital camera, I have to open the drive that is asserted to it and right-click on the driverwindow-icon and then choose "eject". I would like to do this in an easier way, like pressing a widget.

The problem is that I don't manage to figure out what program it is that make this ejection.Is it the usbmonitor program, and in such case what sort of parameter should one use? Or has it somethin to do with LVM, like the "refresh removable media"?


Subject  :  Re:Ejecting USB-devices
Author  :  kb0uov
Date  :  09 Sep, 2005 on 16:15
Try from a command line eject.exe x: eject.exe should be in x:\os2
If that works, then you can make a object for it with a pretty icon.

kb0uov


Subject  :  Re:Ejecting USB-devices
Author  :  Pete losepete@ntlworld.com
Date  :  09 Sep, 2005 on 16:26
Hi Melf

Simple answer: Create a program object on your Desktop/in your Drives folder/Where Ever you want and give it the Path and file name of the below script (file name usbeject.cmd, Path is wherever you keep it

/* USBEject.cmd */
/* Part of the "Nicki's USB Camera to Hard Disk Thingy" application */
/* run to Eject Removable Media either during to Refresh or at Exit of camera.exe */
Drive=Arg(1)

'@Eject ' || Drive || ':'


When you copy the above script and save it put a blank line on the end ie Press the Enter key at the end of the '@Eject ' || Drive line.

The above script should popup a "What Drive letter" entrybox - just enter the drive letter and omit the colon ie M not M: - so it is not limited to 1 drive.

Hope that helps.

Pete


Subject  :  Re:Ejecting USB-devices
Author  :  melf
Date  :  09 Sep, 2005 on 23:13
Thank you guys, that was just what I needed!

Powered by UltraBoard 2000 <www.ub2k.com>