Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
running mid 90's DOS application (through WIN98) which creates a custom print file / sends the file to a custom printer / and then erases the file (file name = printfile.prt).
We can manually capture file just prior to printing by using ctrl/alt/del to call up win98 "close program" screen. After clicking "cancel", we can use windows explorer to look in the program's direcory(C:\customprt) to see and rename the file. If not renamed, file is gone when sent to printer or DOS application is closed.
Is there a DOS or win98 program which can run in the background and capture this file, rename it and/or send it to a different directory. We can read the file and use it, if captured.
Application code has not been supported since 1998. Vendor no longer in business
thanks
dave

It depends on how the program was written and in what language. In some old DOS programs, the programmer just calls the DOS DEL or DELETE or ERASE function to delete the program. If this is the way the program does it, then a simple BATCH file in the programs execution directory might solve your problem.
Try the following: In the programs execution folder, create and test the following three batch files, DEL.BAT, DELETE.BAT and ERASE.BAT. In the batch files, have a simple @ECHO PRINTFILE.PRT statement or something. Then if the program calls the DOS delete command, the "nop" batch file should run instead and not delete the print file. Now this can cause a problem if the program is using the DEL function to delete other files. In this case, you could try changing the nop ECHO command to something likeIF NOT %1/==printfile.prt/ THEN DEL %1
If that idea does not pan out because the program is using INT 21h function calls to do the delete and the program is not too big you could use DEBUG to search the program for the command string used to delete the file and modify the actual program code to not delete the file or to try to delete a different file. It just depends on how the program was written. This requires some programming knowledge and experience, but should not be to hard to have done.
Another approach would be to find out exactly how the program goes about deleting the file and write a custom TSR that runs in the DOS session that traps out that specific call. More work for an experienced programmer but a solution that would work without having to modify the program.
I know of no general program that would do this. There are however several print file capture programs for DOS that can capture the printer port output and save it to a file. You would have to search the old DOS archives for printer utilities and see if any of them work for your application.

I think you can have a batch file running on the background, like this:
echo To exit this program, hit CTRL+C
:loop
if exist printfile.prt goto rename
goto loop
:rename
ren printfile.prt arquive.datThat file will keep looking for the file printfile.prt on the current directory, in a loop. As soon as the file is found, it is renamed and the batch file ends.
Hope that helps.
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br

If the "ren " statement does not work because the program first creates the print file, closes it and then reopens it to write the output, then you could try replacing the "ren " command with "copy /y ..." to make a copy of the file instead. Hopefully the last copy made would be the whole file.

JackG wrote:
> then you could try replacing the "ren "
> command with "copy /y ..." to make a copy
> of the file instead.Yeah, using COPY/Y would be indeed better than REN, since the file may be in use.
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br

![]() |
I don't have a msdos prom...
|
Attempting to read an ini...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |