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.
Command | Explanation | |
---|---|---|
Example | ||
CreateProcess.CommandLine | S | The 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.Environment | S | The environment used for the program, comma and quote separated |
CreateProcess.Environment="spSTC=%startcount%","path=c:\bin" | ||
CreateProcess.CurrentDirectory | S | Sets the current directory for the program that is started |
CreateProcess.CurrentDirectory= D:\ihsStartPrg\somebase | ||
CreateProcess.Priority | N | Sets the windows priority for the started program (0 (Low)-3 (Real Time) ) |
CreateProcess.Priority=0 | ||
CreateProcess.MaxProcesses | N | Sets the maximum number of programs started at the same time |
CreateProcess.MaxProcesses=5 | ||
CreateProcess.MaxQueueCount | N | Sets the maximum number of processes pending |
CreateProcess.MaxQueueCount=10 | ||
CreateProcess.MaximumRunTime | N | Sets te maximum run time in minutes of a process started by startprog |
CreateProcess.MaximumRunTime=72 | ||
Timer.Interval | N | The time to wait between two search actions |
Timer.Interval=1000 | ||
Timer.WaitOnQueueFull | N | Extra time to wait when the queue is full |
Timer.WaitOnQueueFull=300 | ||
Timer.IntervalOnStart | N | Time to wait before a new search when a program was started |
Timer.IntervalOnStart=100 | ||
LogFile.FileName | S | The full file name of the log file |
LogFile.FileName=D:\ihsStartPrg\test.log | ||
LogFile.Active | B | Do we need a log file |
LogFile.Active=TRUE | ||
LogFile.SizeLimit | N | The log file is circular, this value means it's maximum size in bytes on disk (and in memory) |
LogFile.SizeLimit=100000 | ||
LogFile.AutoSave | B | Save 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.Verbosity | N | Sets the Verbosity of the logging, 0 -> only errors, 7 -> extremely chatty |
LogFile.Verbosity=2 | ||
FreeTimeStamp | S | You 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 | ||
DeleteAfterRun | B | Delete the temporary file after the program has been run / Start the StopSQL query |
DeleteAfterRun=TRUE | ||
RetryFileOnFail | B | Rename the file to it's original name / Start the ErrorSQL query, when the calling application returned a value higher than 0 |
RetryFileOnFail=TRUE | ||
OnlyProcessKnownVars | B | This 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* | S | The Root directory where the program will search from |
Basedir=D:\ihsStartPrg\somebase | ||
BasedirN* | S | The Nth Root directory where the program will search from (1<N<65000) |
Basedir1=D:\otherdir | ||
ExcludeExtentions* | S | A list of extensions (within quotes) that will be ignored when found, comma and quote separated |
ExcludeExtentions=".dcl",".bat" | ||
OnlyIncludeExtentions* | S | Only 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* | B | Traverse into subdirectories |
IncludeSubdirectories=FALSE | ||
ProcessFilesInBaseDir* | B | Process files in Base directory |
ProcessFilesInBaseDir=TRUE | ||
StartAtRootDir* | B | When 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& | S | This 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& | S | A 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& | S | A 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& | S | A 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& | S | A 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& | S | A 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& | S | A 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 :
Prefix | Effect | Example |
---|---|---|
OriginalExtention | Commandline is dependent on incoming extention | txt.CreateProcess.CommandLine=... |
level1 | The name of the first directory | level1dir.CreateProcess.CommandLine=... |
level2 | The name of the second directory | level2dir.CreateProcess.CommandLine=... |
level3 | The name of the third directory | level3dir.CreateProcess.CommandLine=... |
level4 | The name of the fourth directory | level4dir.CreateProcess.CommandLine=... |
OriginalFile | The fullname of the incoming file (without path) | spoolfile.txt.CreateProcess.CommandLine=... |
OriginalFileNoExt | The name of the incoming file (without path or extention) | spoolfile.CreateProcess.CommandLine=... |
BaseDirCount | The Basedirectory number | 0.CreateProcess.CommandLine=... |
VD_DAT_IM | If you set this variable with a valid hexadecimal value, it will generate VD_Dir_Name | select 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 :
Prefix | Effect | Example |
---|---|---|
OriginalExtention | When you have this fieldname in the BaseSQL or PreQueueSQL statement it will be used as a configuration modifier | |
level1 | When you have this field name in the BaseSQL or PreQueueSQL statement it will be used as a configuration modifier | |
level2 | When you have this field name in the BaseSQL or PreQueueSQL statement it will be used as a configuration modifier | |
level3 | When you have this field name in the BaseSQL or PreQueueSQL statement it will be used as a configuration modifier | |
level4 | When you have this field name in the BaseSQL or PreQueueSQL statement it will be used as a configuration modifier | |
OriginalFile | When you have this field name in the BaseSQL or PreQueueSQL statement it will be used as a configuration modifier | |
OriginalFileNoExt | When you have this field name in the BaseSQL or PreQueueSQL statement it will be used as a configuration modifier | |
BaseDirCount | The Basedirectory number |