-dsmsearchorder

Top  Previous  Next

-dsmsearchorder searchOrder

 

The -dsmsearchorder parameter determines the directories and what order TwainSave will search these directories when attempting to load the TWAIN Data Source Manager (DSM).  For more information on the DSM file, please refer to return code 2 and the DSM files that are necessary to run TWAIN applications.

 

The DSM is either TWAIN_32.DLL or TWAINDSM.DLL.  Depending on your system, you may want TwainSave to look for one of these files using a specific directory search order.

 

The valid values for searchOrder are as follows:

 

searchOrder value

Directories searched

0

WINDOWS, SYSTEM, PATH

1

WINDOWS, PATH, SYSTEM

2

SYSTEM, WINDOWS, PATH

3

SYSTEM, PATH, WINDOWS

4

PATH, WINDOWS, SYSTEM

5

PATH, SYSTEM, WINDOWS

6

WINDOWS only

7

SYSTEM only

8

PATH only

9

WINDOWS, SYSTEM

10

WINDOWS, PATH

11

SYSTEM, WINDOWS

12

SYSTEM, PATH

13

PATH, WINDOWS

14

PATH, SYSTEM

 

So for example, a -dsmsearchorder value of 1 would search for the DSM file first in the WINDOWS directory, then if not found the PATH, and if not found there, the SYSTEM directory.

 

The terms WINDOWS, SYSTEM, and PATH are aliases to actual directories and searching locations.  Here is a detailed description of each term:

                     

The WINDOWS directory is the directory reported by your system to be the "Windows" directory.  This is usually C:\Windows, but it may be different for your system.

 

The SYSTEM directory is the directory reported by your system to be the "System" directory.  This is usually C:\Windows\System32, but it will be different depending on OS version and whether the system is a 64-bit system.

 

The PATH is the list of directories in your PATH environment variable.  In actuality, the PATH is just one of the set of directories that will be searched when PATH is specified.  When searching for DLL's, Windows goes through an extensive list of possible locations, where the PATH is one central location.  To see the list of searches done by Windows, the following link describes the search logic:

 

Windows DLL Search order

 

Example:  Search for TWAIN DSM in only the Windows directory and then acquire image using this DSM.

twainsave -dsmsearchorder 6 -filename test.bmp

 

 

 

Default Setting:

If -dsmsearchorder is not specified, the search order is 0 (WINDOWS, SYSTEM, and then PATH).