>Hello,
>
>We've got a Novell file/print server with about 150 clients. The clients are running either Win9x or Win2k with the appropriate Novell Netware client.
>
>I'm trying to use CopyFile (from the Win API) to send a file directly to a printer. I've tried the following syntaxes (which others have told me are correct) but I'm not having any luck.
>
>(Syntax I'm showing is the way I would type them from the Fox command window)
>
>? CopyFile("c:\test\rodd.txt","LPT1:",0)
>? CopyFile("c:\test\rodd.txt","PRN:",0)
>? CopyFile("c:\test\rodd.txt","\\servername\queuename",0)
>
>(I actually used the correct servername and queuename when I ran the command of course).
>
>I had no problem running the command to copy a file to a new file.
>? CopyFile("c:\test\rodd.txt","c:\test\rodd2.txt",0)
>
>In the first example (LPT1:), I had that port captured to the proper Novell print queue but the CopyFile command continually returned 0.
>
What does GetLastError() return after CopyFile() fails - GetLastError() will return an error code describing the reason it failed. See the FAQ entry on using CopyFile(); I've used CopyFile() successfully with at least some versions of Novell using the MS Client for NetWare using the mapped port.
>I'm guessing this has something to do with Novell being in the mix but I'd like to hear it from someone who knows. It still seems like it should work in that other DOS apps seem to care less about the capture when you tell them to print to LPT1, they just do it and everything works great. I'm not sure why CopyFile would be any different.
I've been told that some versions of the Novell print server require that you specify a target name for the queued output rather than just the share name - some versions of NetWare treat the queue as a folder rather than as a device.
CopyFile() isn't a DOS command, it's a Windows API call.