can anyone help me with a temporary fix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • miroku800
    New Member
    • Mar 2007
    • 21

    can anyone help me with a temporary fix

    Hello

    I have an old Pascal program that runs in a DOS box that runs a 'one time' result to a txt file (the program is being slowly rewritten in a more modern language but I need to use it occasionally meantime)

    Is there any way I can start it in VB6 then just use the program in its DOS format and have the .TXT file sent to the printer when the 'go' command is given

    The DOS program works fine in Win XP but just saves the file to disk somewhere and we really need it to produce a 'one off' print from the default printer

    Many thanks for any ideas

    regards Rob
  • Guido Geurs
    Recognized Expert Contributor
    • Oct 2009
    • 767

    #2
    Attached is a VB6 program that runs a BAT file and print the result file on the default printer.
    Attached Files

    Comment

    • miroku800
      New Member
      • Mar 2007
      • 21

      #3
      Originally posted by ggeu
      Attached is a VB6 program that runs a BAT file and print the result file on the default printer.
      Many thanks for that, will it also work with an exe file

      Comment

      • Guido Geurs
        Recognized Expert Contributor
        • Oct 2009
        • 767

        #4
        yes, just enter the path of an .EXE like Notepad.exe in the textbox of Dosfile and Notepad will open.

        PS: you can save the settings like the path of the DOSfile and the path of the .TXT file in a file so you don't have to re-enter it every time you run the program.
        Do you need any help with that ?

        Comment

        • miroku800
          New Member
          • Mar 2007
          • 21

          #5
          Oh yes please
          Its many years since I had to program in VB and am having difficulty in getting back into it and am having to dig out the reference books
          the DOS file is called RAFFLE.EXE
          and the text file (that the program produces automatically) is called RAFRES2.TXT

          Its very kind of you to provide this help and it is much appreciated

          PS. the Txt file could be made to print automatically without the button if that's easier

          Comment

          • Guido Geurs
            Recognized Expert Contributor
            • Oct 2009
            • 767

            #6
            Originally posted by miroku800
            Oh yes please
            Its many years since I had to program in VB and am having difficulty in getting back into it and am having to dig out the reference books
            the DOS file is called RAFFLE.EXE
            and the text file (that the program produces automatically) is called RAFRES2.TXT

            Its very kind of you to provide this help and it is much appreciated

            PS. the Txt file could be made to print automatically without the button if that's easier
            Q1: is the path of the EXE and the TXT file the same?
            Q2: if so, is it possible to place our start program in the same folder of the EXE and TXT file ?

            Comment

            • Guido Geurs
              Recognized Expert Contributor
              • Oct 2009
              • 767

              #7
              This attachment is a code and program to place in the folder of the EXE and TXT files.
              It runs the EXE with the command "Run..." and if the chechbox "Auto Print" is checked, it checks each 10 sec if the TXT file is in the folder.
              If so, it sends the TXT file to the default printer.

              You can also print the TXT file by clicking on "Print..."
              Attached Files

              Comment

              • miroku800
                New Member
                • Mar 2007
                • 21

                #8
                Originally posted by ggeu
                This attachment is a code and program to place in the folder of the EXE and TXT files.
                It runs the EXE with the command "Run..." and if the chechbox "Auto Print" is checked, it checks each 10 sec if the TXT file is in the folder.
                If so, it sends the TXT file to the default printer.

                You can also print the TXT file by clicking on "Print..."
                Thats absoulutly brilliant many thanks for your help

                Comment

                Working...