Starting TwainSave

Top  Previous  Next

In general, to start TwainSave, please go to the directory where you installed TwainSave.  In that directory you will find a program called TwainSave.exe or TwainSave64.exe (if you are using the 64-bit version of TwainSave).


Alternately, you can set your PATH environment variable and add the TwainSave installation directory to the path and run TwainSave from any directory.


Please note:  This document refers to the TwainSave executable as "TwainSave.exe" or "twainsave.exe".  If you're using the 64-bit version of TwainSave, all references in this documentation that refers to "TwainSave.exe" applies to "TwainSave64.exe".


In general, to invoke TwainSave the following command line command is given:


twainsave [options]


where [options] are the various command-line options that are available.  All the command options are preceded with a hyphen (-) or with a forward slash (/).  For example, these two commands do exactly the same thing:


twainsave /filename test.tif /noui

twainsave -filename test.tif -noui


For the remainder of this documentation, the commands will be preceded with a hyphen.


Very important:


The options are case-sensitive.  For example, an option of -p and -P are two different options.
Options that have spaces in the arguments must be enclosed in double quotes:

 Example - set the file name to c:\My Documents:

 -filename "c:\My Documents"


 Example - set the area to acquire as a 3 x 3 inch square:

 -area "0 0 3 3 inch"

An example of a TwainSave command-line with multiple options:


twainsave -filename test.bmp - F bmp -nouiwait -color 2 -papersize A4 -rotation 90


The above line acquires a file called "test.bmp" (-filename).  The file will be in the Windows BMP format (-filetype option), a color image (-color), page size will be A4 paper size (-papersize option), and will be rotated 90 degrees clockwise (-rotation).  In addition, the user interface for the device will not be shown, and the device will wait for paper to be placed in the document feeder, scanning automatically when the paper is detected (-nouiwait)


The easiest way to start to use TwainSave is to start a new Command Prompt, and ensure that TwainSave.exe is available, either in the current directory or in a path specified by your operating system's PATH environment variable.  (Note that for 64-bit TWAIN devices, you must use the TwainSave64.exe program to access these devices).


Please note:  It is not recommended to start TwainSave.exe by "double-clicking" in Windows Explorer or similar application.  TwainSave is a command-line program, and it is always best to either do one of the following to run the program:


1) Open a command window and run the application this way.  Since TwainSave.exe writes to the command window, you may miss important information that is outputted to the command window by double-clicking or selecting from Explorer, since the command window when started from Explorer may open and close immediately.


2) Use the "Start-Run" option of Windows XP and below, or the "Search programs and Files" option when you press the "Windows" key when running Windows 7/Vista.  For this to work, TwainSave.exe must be in a directory accessible by your system's PATH environment variable


3) If you're using a GUI-based command-line utility (similar to Total Commander), you can enter the TwainSave commands from the command-line using such utilities.



The example below demonstrates TwainSave when started from the command-line.


The following starts TwainSave and opens the TWAIN "Select Device" dialog box (this assumes that the twainsave.exe program is accessible from the C:\ directory)




Once the device is selected, the device's user interface will be displayed, allowing you to start the scanning or image retrieval process.




The number of items that appear in the "Select TWAIN device" dialog box depends on the number of installed drivers.


Please note that if you're running the 64-bit version of TwainSave, TwainSave64, the number of drivers that are displayed may be less than the number of drivers displayed when running the 32-bit version of TwainSave.  The reason for this is that 64-bit TwainSave will only list the 64-bit TWAIN drivers, as you cannot acquire from 32-bit devices from a 64-bit application.


The image retrieved will be saved in Windows bitmap (BMP) format, and the name of the file will be "test.bmp".


Various options are available to save to a different file format, select the device without the "Select TWAIN device" dialog from displaying, retrieving the image without displaying the device's user interface, acquiring multiple pages, etc.  It is recommended that you start with the basic set of command-line options (for example, acquire to another image type, change the file name, etc), and then add the more advanced options (for example, job control) as you get more experienced with using TwainSave.


By default, a console window will appear when running TwainSave.  To turn off the console window when TwainSave starts up, use the -noconsole command option.


If an illegal or unsupported command-line option is specified, TwainSave will present a list of the available options in the command window.  If the -noconsole option is present, the list of options will be displayed in a message box.