Forum Home
Press F1
 
Thread ID: 20186 2002-05-31 04:05:00 print to file Guest (0) Press F1
Post ID Timestamp Content User
51706 2002-05-31 04:05:00 I am using a dos application across a network. When I require a printout I use NET USE commands to print to a network printer eg NET USE lpt1: \\server\printername, which works fine. However occasionaly, I wish to print to FILE. How do I print to file. Is there a net use command our other that enables me to do this? Guest (0)
51707 2002-05-31 05:20:00 I seem to remember (though I haven't done it for a long time) that the DOS spooler 'print' command will accept redirection. Just do 'print thefile.ext > myfile.txt'. Do *not* call it 'prn.txt' or 'lpt.txt'. DOS has the endearing trick by which it actually writes to the *device* whose name you have started a filename with. So avoid con, aux, com, lpt, prn, nul. (there is one other --- can't think of it).

You might also be able to do 'print thefile.ext > \\server\path\myfile.txt'.
Guest (0)
1