View Full Version : Help with creating a batch file
05-01-2004, 12:48 AM
I'm a simpleton here - I need help with creating a batch file (or something that will perform this function) :
I want to build a "software copier" using my scanner. I'm trying to set up something so I can put a document in the scanner - have it scan (100 ppi) - "fit to page - and print as a single function.
Not planning to buy a copier anytime soon - I have no problem scanning a doc at a 75-100 ppi resolution and then printing it -
but why not have an icon to click and avoid the process of launching my scanner software - setting resolution - select scan - select print - select "fit to page" - select OK . . .
Any help appreciated
05-01-2004, 01:07 AM
Hmm.. That might not be as easy as it sounds..
First off, what OS are you running? If it's windows it's probably harder to do.. it'd also be called a Script file - not a batch file. If it's Linux, it's probably doable as most programs come with a command line interface..
But for some reason I'm gonna assume Windows:
In order to communicate with your Scanner, you need to actually communicate with its driver. Loading up the software which is specifically designed to communicate with the driver is the easiest way.
Is there a button, or key-combination (like ctrl+2 or something weird like that), in your scanning software to scan an image? How about quick-keys for fit to page... ? and then print?
I'm wondering if you could create a script file that would launch your scanning software, and then you can have the script file press the key combinations in order and scan, fit, and print the document.
If you can't manage that, I don't think it's gonna be too easy to do.. unless your scanning software is user-programmable (ie. includes some sort of a script language... sort of like MS Office apps and VBA), then it could very well be possible.
Hope that's some help to you.
05-01-2004, 08:57 AM
But for some reason I'm gonna assume Windows
What reason could there be to do that? ;)
But I'll make the same assumption.
I don't know about sending keystrokes from a script, but you sure can do that in C++ or VB. If you know how to program you can try starting up your scanner software (maybe minimized) and send it's window the appropiate messages.
For a script I think you'll need a command line interface, and you won't know if you have one until you check your manual.
05-02-2004, 04:33 PM
Thanks for the inputs. . . Yes I run Win 98.
Reason = Just bought a new HP Printer/Scanner/Copier/Fax - - I was hoping to upgrade my capibility by adding the Copier & Fax - it was a disaster all the way - perhaps a system incompatibility or unit hardware issue. In any case HP could not talk me through it. - - - Back to Walmart it went !
Then I got to thinking - I have a scanner that's great - I have a printer so why not try to combine the motions of scanning and printing into one easy mouse click. This is mostly for my wife's benifit, but I like the idea too.
Sorry - I'm VB illiterate - I should try use & learn the app more - but it's a time thing for me. I have an 1800s version of VB but never explored it much.
Maybe I should get a VB for Dummies book . . :)
05-02-2004, 05:30 PM
A VB for Dummies book won't help you too much here. What you'll need are mostly Win32 API calls (like SendMessage() to send a "keystroke" to the app), and that isn't covered in any beginner's or intermediate VB texts. So you probably need some Windows 32 Programming for Dummies book then (but the internet, specially MSDN, would be much more useful).
But before you start on that you should really look at the documentation you got with your printer and your scanner. Chances are there is a command line interface (or some sort of API) and that would make the whole process much easier.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.