I am getting the error from @ERROR and @SERROR. I see now that my description of the errormessage has not been correct, as I referred to both errors.
The correct will be that @ERROR returns '3012' (or '10') and @SERROR returns 'No Printers were found' (or 'The environment is incorrect')

The script runs from a GPO.
There have been issues about the %ClientName%, but that is solved, and initially in the script I check that the %ClientName% has been set, to ensure that I can process the script further on.

Here's an extraction from my logfile which shows that %ClientName% has been set:

 Code:
18:41:45 ----> Kix versjon: 4.62
18:41:45 ----> @wksta: TS-Server1
18:41:45 ----> %clientname%: User1
18:41:45 ----> Logonserver: \\Logonserver1

18:41:45 ----> DefaultPrinter from registry: \\Printsrv1\Dummy_Printer,winspool,Ne00:
18:41:47 ----> ----------------------------------------------------------------------------------------
18:41:47 ----> Printermappings
18:41:47 ----> Failure adding printer \\Printsrv1\Printer1 3012 No printers were found.
18:41:47 ----> Failure adding printer \\Printsrv1\Printer2 10 The environment is incorrect.
18:41:47 ----> Failure adding printer \\Printsrv1\Printer3 10 The environment is incorrect.
18:41:47 ----> Unsucessful setting \\Printsrv1\Printer1 as default printer: Errorcode 2
18:41:47 ----> ----------------------------------------------------------------------------------------
18:41:48 ----> Default printer at end of login: 
18:41:48 ----> LOGINSCRIPT END


There is NO QUESTION about the printers being available at the time, and what makes this strange is that at my next logon, everything might be ok \:o


Jon
_________________________
I was placed on earth to do a job. Right now I have so much to do, I will never die..