Solved

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

Posted on 2004-08-12
3
196 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:hdhondt
hdhondt earned 125 total points
ID: 11789114
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
ID: 11804925
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
ID: 11820199
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
When I recently replaced my image transfer kit on my office HP color laserjet 5550dn printer, I had a slight problem.  The left bracket that holds the transfer kit got stuck in the upright locked position instead of being at a 45 degree angle facing…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

813 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

15 Experts available now in Live!

Get 1:1 Help Now