Yuri,
>I seem it should be set printer to NAME \\servername\printername
Thanks for the suggestion, but the original question was for FoxPro DOS, which does not have the NAME clause. Your code in DOS version would result in the printer device being set to "NAME".