in reply to Deleting the Currently Running Script in Win XP

Rather simpler would be to run an asynchronous perl one-liner at the end of the script that waits a couple of seconds for the script to terminate and then deletes it like this:

P:\test>type junk.pl #! perl -slw use strict; sleep 10; ## Simulate doing stuff ## Start an asynchronous perl one-liner ## sleep a couple of seconds and the delete the script ($0) system 1, qq[ perl -e"sleep 2; unlink'$0'" ]; P:\test>junk P:\test>dir junk.pl Volume in drive P has no label. Volume Serial Number is BCCA-B4CC Directory of P:\test File Not Found

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.