$NameParm = $ARGV[0];

$NameParm =~ s/^(.:)?.*\\//;			# strip device and directory
$Ext = $1 if ($NameParm =~ s/\.(.*?)$//);	# remove (& remember) extension

unshift (@ARGV, "perl") if ($Ext =~ /pl/i);	# prepend perl if perl script
						# (takes care of redir problem)
open (BATCHSTUB, ">F:\\temp\\${NameParm}.bat");
print BATCHSTUB join(" ", @ARGV),"\n";
close BATCHSTUB;
system 'cmd', '/c', 'move', "F:\\TEMP\\${NameParm}.bat",
    			    "F:\\Batch\\${NameParm}.bat";
