|
-
Nov 1st, 1999, 01:57 AM
#1
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????
-
Nov 1st, 1999, 02:40 AM
#2
Guru
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
-
Nov 1st, 1999, 06:38 AM
#3
Lively Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|