You should read A Logon Script Does Not Work If %0 or %0\..\ Calls Multiple Commands about the usage of %0 in logon batch files. I think it is a bad idea to map the logon drive to z: to work around the problem.