?
Solved

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

Posted on 2004-08-12
3
Medium Priority
?
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 38

Assisted Solution

by:hdhondt
hdhondt earned 500 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 500 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

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

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

This seems to be a very common error related to the Samsung printer driver. First, this is the error we're talking about: Log: System Type: Error Event: 7000 Agent Time: 3:37:24 am 22-Apr-09 Event Time: 6:07:24 pm 21-Apr-09 UTC Source: Se…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Suggested Courses
Course of the Month13 days, 19 hours left to enroll

800 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