Page 1 of 1

AutoEject Pstart on Exit

Posted: Sun Jul 15, 2007 4:02 pm
by crownixx
AutoEject Pstart on Exit

PStart store portable application shortcut in usb stick.Everytime we want to unplug the usbstick we must exit our PStart first.Now reduce 2 work into 1 work.
Easy and more simple guide. No confusing script and the ejecting will work on both Admin rights and No admin rights
Cool huh, 8)

Guide
-------

1.Download RemoveDrive from Uwe Sieber

Code: Select all

http://www.uwe-sieber.de/files/removedrive.zip
2. Insert RemoveDrive.exe into your usb stick.. this can be in any place


3.Make a shortcut for RemoveDrive.exe in your PStart menu

Image

4. Right click and choose edit

Image

5. In General tab, insert %pdrive% under the Command line parameters

Image

6. Go to Advanced tab, on Autorun, choose on exit

Image

7. Done.. was that hard?

More explaination?
----------------------

In step [6], the RemoveDrive.exe will execute after the PStart exit.
In step [5], those parameter is enough to make it work but you can add more RemoveDrive parameters as you like. Read the RemoveDrive Readme for more info.
Usage:
RemoveDrive DriveSpec: [-l][-h][-w:nnnn]

DriveSpec: is the drive to remove, e.g. U:
[-l] loop until success
[-b] let Windows show the "it's save now" balloon tip
[-h] show open handles (admin rights required, exprimental, may freeze!)
[-w:nnnn] wait nnnn milliseconds before close
[-d] show debug information
Below is the screenshort for my parameters

Image

Code: Select all

%pdrive% -l -h -w:3000
How it work?
---------------

RemoveDrive.exe will copy itself into the temp folder, ejecting your pendrive correspond the the parameter you had
set and delete itself in the temp folder.

Have a nice day

Posted: Mon Aug 06, 2007 12:25 pm
by Kaonashi
Hi crownixx,

Very nice guide! I had just implemented RemoveDrive a week or two before you posted this. However, I use a command line script that is run upon exitting PStart, which first copies RemoveDrive.exe to %tmp%, runs it from there and finally deletes it. I'm missing this in your guide, still you state
RemoveDrive.exe will copy itself into the temp folder, ejecting your pendrive correspond the the parameter you had
set and delete itself in the temp folder.
Am I overlooking something or did you forget something?

Posted: Mon Aug 06, 2007 3:32 pm
by crownixx
you miss the removedrive readme..it can copy itself to the temp folder
Returns Errorlevels:
4 - RemoveDrive.exe located on the drive to remove -> temporary copy created and executed

Posted: Mon Aug 06, 2007 11:58 pm
by Kaonashi
Aha! That is very useful, thanks!

Posted: Fri Sep 07, 2007 12:49 am
by back-slap
Hi crownixx,

Excellent job! Thanks! :D

Posted: Fri Sep 07, 2007 4:03 pm
by crownixx
you're welcome :D
credits to uwe-sieber making this great tiny app,
and PStart coz making this %pdrive% parameter..make our live easy

Posted: Fri Sep 07, 2007 6:04 pm
by Ttech
Nice...
Question though, whats the Close All Windows app? :)

Posted: Fri Sep 07, 2007 6:28 pm
by crownixx
aah, that one is another helper lazy tools for me before ejecting my thumbdrive. get it here
http://www.ntwind.com/software/utilities/close-all.html
This tool helps you to close all running applications with one click. It does not use system resources because it only flashes a ‘close’ signal to all open windows on the desktop and then ceases.