The config file is a plain text file that will be searched in the folder where the service is installed. the file must have the name ihsStartProgram.cfg or ihsStartProgramDB.cfg, see Example Config File and Example Config File DB.

CommandExplanation
 Example
CreateProcess.CommandLineSThe command line used to start a program when a file is found, see Arguments for more explanations
 CreateProcess.CommandLine= D:\ihsStartPrg\project1.exe "%FileName%"
CreateProcess.EnvironmentSThe environment used for the program, comma and quote separated
 CreateProcess.Environment="spSTC=%startcount%","path=c:\bin"
CreateProcess.CurrentDirectorySSets the current directory for the program that is started
 CreateProcess.CurrentDirectory= D:\ihsStartPrg\somebase
CreateProcess.PriorityNSets the windows priority for the started program (0 (Low)-3 (Real Time) )
 CreateProcess.Priority=0
CreateProcess.MaxProcessesNSets the maximum number of programs started at the same time
 CreateProcess.MaxProcesses=5
CreateProcess.MaxQueueCountNSets the maximum number of processes pending
 CreateProcess.MaxQueueCount=10
CreateProcess.MaximumRunTimeNSets te maximum run time in minutes of a process started by startprog
 CreateProcess.MaximumRunTime=72
Timer.IntervalNThe time to wait between two search actions
 Timer.Interval=1000
Timer.WaitOnQueueFullNExtra time to wait when the queue is full
 Timer.WaitOnQueueFull=300
Timer.IntervalOnStartNTime to wait before a new search when a program was started
 Timer.IntervalOnStart=100
LogFile.FileNameSThe full file name of the log file
 LogFile.FileName=D:\ihsStartPrg\test.log
LogFile.ActiveBDo we need a log file
 LogFile.Active=TRUE
LogFile.SizeLimitNThe log file is circular, this value means it's maximum size in bytes on disk (and in memory)
 LogFile.SizeLimit=100000
LogFile.AutoSaveBSave the log file with every addition or once per cycle, setting this to true can sometimes give locking problems if you want to read the log.
 LogFile.AutoSave=FALSE
LogFile.VerbosityNSets the Verbosity of the logging, 0 -> only errors, 7 -> extremely chatty
 LogFile.Verbosity=2
FreeTimeStampSYou can put in a string with a specific format that will create a time stamp in the variable %mytimestamp%
 FreeTimeStamp=yyyymmdd"T"hh":"nn":"ss
DeleteAfterRunBDelete the temporary file after the program has been run / Start the StopSQL query
 DeleteAfterRun=TRUE
RetryFileOnFailBRename the file to it's original name / Start the ErrorSQL query, when the calling application returned a value higher than 0
 RetryFileOnFail=TRUE
OnlyProcessKnownVarsBThis Option when set to true allows you to add arbitrary values in the config file, In the DB version this is used to get data from the fields in a query
 OnlyProcessKnownVars=FALSE
Basedir*SThe Root directory where the program will search from
 Basedir=D:\ihsStartPrg\somebase
BasedirN*SThe Nth Root directory where the program will search from (1<N<65000)
 Basedir1=D:\otherdir
ExcludeExtentions*SA list of extensions (within quotes) that will be ignored when found, comma and quote separated
 ExcludeExtentions=".dcl",".bat"
OnlyIncludeExtentions*SOnly start the program when the extension (between quotes) is in this list, leave the list empty for all (Exclude takes precedence), comma and quote separated
 OnlyIncludeExtentions=
IncludeSubdirectories*BTraverse into subdirectories
 IncludeSubdirectories=FALSE
ProcessFilesInBaseDir*BProcess files in Base directory
 ProcessFilesInBaseDir=TRUE
StartAtRootDir*BWhen the directory path of the Basedir is smaller than 4 characters, the service does not start unless this option is set to TRUE
 StartAtRootDir=FALSE
Connectstring&SThis is the default connect string for the sql statements, more on connect strings.
 Connectstring=Provider=SQLOLEDB;Server=servername;Database=databasename;UID=user;PWD=passwd;
BaseSQL&SA SQL string Resulting in one line starting with a key value and containing some or all information to start a program
 BaseSQL=Select top 1 * from f04 where Exported=0
PreQueueSQL&SA SQL string Resulting in one line containing all or some information to start a program, example assumes the BaseSQL call returned at least a value called Identifier
 PreQueueSQL=Select top 1 * from SomeTableOrView where identifier=
QueueSQL&SA SQL string updating the database to indicate the queueing of the program
 QueueSQL=update F04 set QueNumber=%startcount%, QueDate=GetDate(), Exported=1 where DAT_IM = '%dat_im%'
StartSQL&SA SQL string updating the database to indicate the Start of the program
 StartSQL=update F04 set StartDate=GetDate(), Exported=2 where DAT_IM = '%dat_im%'
StopSQL&SA SQL string updating the database to indicate the program has stopped
 StopSQL=update F04 set EndDate=GetDate(), Result=%exitvalue%, Exported=3 where DAT_IM = '%dat_im%'
ErrorSQL&SA SQL string updating the database to indicate the program has created an error
 ErrorSQL=update F04 set EndDate=GetDate(), Result=%exitvalue%, Exported=99 where DAT_IM = '%dat_im%'

* only works with StartProg
& only works with StartProgDB

In StartProg you can also create these extra options :
The vaules CreateProcess.CommandLine and CreateProcess.Environment can be preceded by one of the following properties :

PrefixEffectExample
OriginalExtentionCommandline is dependent on incoming extentiontxt.CreateProcess.CommandLine=...
level1The name of the first directorylevel1dir.CreateProcess.CommandLine=...
level2The name of the second directorylevel2dir.CreateProcess.CommandLine=...
level3The name of the third directorylevel3dir.CreateProcess.CommandLine=...
level4The name of the fourth directorylevel4dir.CreateProcess.CommandLine=...
OriginalFileThe fullname of the incoming file (without path)spoolfile.txt.CreateProcess.CommandLine=...
OriginalFileNoExtThe name of the incoming file (without path or extention)spoolfile.CreateProcess.CommandLine=...
BaseDirCountThe Basedirectory number0.CreateProcess.CommandLine=...
VD_DAT_IMIf you set this variable with a valid hexadecimal value, it will generate VD_Dir_Nameselect top 1 dat_im as VD_DAT_IM from table where status = 0

In StartProgDB you can also create these extra options :
The values CreateProcess.CommandLine, CreateProcess.Environment, `Connectstring, BaseSQL, QueueSQL, StartSQL, StopSQL and ErrorSQL can be preceded by one of the following properties :

PrefixEffectExample
OriginalExtentionWhen you have this fieldname in the BaseSQL or PreQueueSQL statement it will be used as a configuration modifier
level1When you have this field name in the BaseSQL or PreQueueSQL statement it will be used as a configuration modifier
level2When you have this field name in the BaseSQL or PreQueueSQL statement it will be used as a configuration modifier
level3When you have this field name in the BaseSQL or PreQueueSQL statement it will be used as a configuration modifier
level4When you have this field name in the BaseSQL or PreQueueSQL statement it will be used as a configuration modifier
OriginalFileWhen you have this field name in the BaseSQL or PreQueueSQL statement it will be used as a configuration modifier
OriginalFileNoExtWhen you have this field name in the BaseSQL or PreQueueSQL statement it will be used as a configuration modifier
BaseDirCountThe Basedirectory number



Gesponsorde koppelingen