at windows me (sorry but I am there right now) if you type "doskey /history" you have a list of the more recent commands. The command that run your script is the last one. So you have start substr(1,$i,len($var)-$i) blah blah