Solved

How to get control of a printer driven by an executable program

Posted on 2004-08-12
3
192 Views
Last Modified: 2010-04-12
An application (executable file) allows printing the results of user input.  However, the app seems to use a temporary print file that doesn't get deleted after printing (and the next user gets the print from the original user.)  We can make this work by manually deleting the printfile after each user but seems like a clumsy way to do things.

The printer is BJC 4400--looking at the manual I don't see any printer control codes available.

The app also uses Irfanview viewer (not embedded in the app so we could set some options there I think--but don't think this has anything to do with the printing).

Is there some way to start a batch file after each print to delete the temp print file?  (I don't have access to the source code for the app.)

Or some other way to get this job done?

Thanks, Lyle
0
Comment
Question by:Faurot
3 Comments
 
LVL 38

Assisted Solution

by:Herman D'Hondt
Herman D'Hondt earned 125 total points
Comment Utility
Assuming your application runs in a DOS window, it is very easy to use a batch file that first runs the application and then deletes the data file. Using a text editor (e.g. Notepad) create a file called RUNMYAPP.BAT

Type the following as the contents of the file:
C:\PathToApp\Appname.exe
DEL C:\PathToDataFile\DataFile

where PathToApp, etc, are replaced with the real path to the application, etc.

Now, instead of double-clicking your application, double-click RUNMYAPP.BAT

Remember this will ONLY work if your app runs from a DOS prompt; if it is a WIndows application I cannot give any guarantees.
0
 
LVL 8

Accepted Solution

by:
thoffman earned 125 total points
Comment Utility
I thought Irfanview was a Windows-only program. If so, and you're running under windows, you'd be better off getting a device context to the printer and use the proper printing APIs to let Windows handle all the spooling. If you didn't write this program, I'd be curious to know why an app with access to Windows wouldn't just use the APIs.

What operating system are you running? Where are these temporary files, and what are they called? There should be a way to automatically delete them, but the answer depends on the OS and what the files are.
0
 

Author Comment

by:Faurot
Comment Utility
hdhondt and thoffman,

Thanks for your input.

I split the points to give you both credit for attempting to help with this problem.  

As it turns out, the program itself has problems that probably will require the programmers to address in the source code (which I don't have access to.)

Thanks, Lyle
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

If you use a Brother DCP 130C or similar Brother printer, at some point you might encounter the following problem: after you change the ink cartridge, the printer displays an "ink empty" message. Sometimes you just need to follow the instructions…
Causes of paper jams:The following are the main causes of paper jams. Guides:If the guides for the paper are not set correctly they may cause the paper to enter at an angle. You should ensure that the guides are set correctly for the paper type a…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now