-
I have a FTP program that downloads .ps files and places them in the desired directory automatically. What I want to do is print these files using the DOS command "copy [filename] lpt1" I've tried every way I could possibly think of. Using the print command in vb is no good because it doesn't print the file out. Any suggestions????
-
This will print a file. The file must be in Text Format.
Sub PrintFile(ByVal sFile As String)
Dim sText As String, iFile As Byte
iFile = FreeFile
Open sFile For Input As iFile
sText = Input(LOF(iFile), iFile)
Close iFile
Printer.Print sText
Printer.EndDoc
End Sub
Usage:
Call PrintFile("C:\Autoexec.bat") ' This prints C:\Autoexec.bat on the default printer
------------------
Yonatan
Teenage Programmer
E-Mail: [email protected]
ICQ: 19552879
-
to print a file from DOS, do this:
prn c:\file.txt
that is it!
P.S. I'm the DOS Batch-Man, I make DOS batch file games, http://bad5887.homepage.com