where you are getting these errors from?
the program or @error?

and you are running this script as logonscript? via gpo? or via usermanager?

you are not checking that %clientname% is set. it might not be there when script gets the ID...
_________________________
!

download KiXnet