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
Solved

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

Posted on 2004-08-12
3
199 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Best way to share an MFP laser printer? 5 94
How to make my old USB printer wireless? 71 219
Timesheet 2 21
Remote Desktop Microsoft Certified Printers 9 18
How to solve seemingly unsolvable printer issues. Users sometimes run into printing issues where all the normal steps do not seem to work. Well the steps below can show users how to take one extra step beyond the normal steps needed to remove old…
Printers have changed substantially in the last 30 or so years, not just in technical capabilities but in cost and usage as well.  Printers were originally used for interfacing with the operator, not necessarily for printing copy or pictures. In …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
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…

856 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