Computing.Net > Forums > Disk Operating System > capture temporary file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

capture temporary file

Reply to Message Icon

Name: dave
Date: July 15, 2003 at 19:41:20 Pacific
OS: win98-2nd edition
CPU/Ram: 128
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: JackG
Date: July 15, 2003 at 20:37:38 Pacific
Reply:

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.



0

Response Number 2
Name: Secret_Doom
Date: July 15, 2003 at 22:30:38 Pacific
Reply:

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.dat

That 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


0

Response Number 3
Name: JackG
Date: July 16, 2003 at 06:19:59 Pacific
Reply:

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.


0

Response Number 4
Name: dave epee
Date: July 16, 2003 at 16:48:59 Pacific
Reply:

Thank you all....problem solved !!!!

dave


0

Response Number 5
Name: Secret_Doom
Date: July 16, 2003 at 19:23:57 Pacific
Reply:

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


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon

I don't have a msdos prom... Attempting to read an ini...



Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: capture temporary file

delete temporary files www.computing.net/answers/dos/delete-temporary-files/14941.html

Older 386 PC www.computing.net/answers/dos/older-386-pc/1030.html

dos printing to file www.computing.net/answers/dos/dos-printing-to-file/11516.html