Results 1 to 3 of 3

Thread: DOS Prompt

  1. #1
    Guest

    Post

    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????

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Post

    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



  3. #3
    Lively Member
    Join Date
    May 1999
    Posts
    64

    Post

    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
  •  



Click Here to Expand Forum to Full Width