Command line mode
Top  Previous  Next


Any SetupBatcher script can be started from the command line / called from another application, but by default, only the first row of the [Data] section is processed (see the "/alldata" switch below for how to process all rows).

Notice: the personal license version of SetupBatcher can not be started from the command line.

Command line syntax

admwin.exe /SB filename [/r options] [/alldata] [/undo]

/SB
Start SetupBatcher  

filename

Full path to script file to execute  

/r options [Optional parameter]   
Replace text in section  
 
alt. 1) Search for string and replace entire row  
 
Options format: Section, RowToReplaceContainsText, ReplaceEntireRowWith  
 
Section - settings, machines, batch or data  
 
RowToReplaceContainsText - text to search for  
If an empty string is specified in this parameter, or if the string is not found, "ReplaceEntireRowWith" is added at the end of the specified section.  
 
ReplaceEntireRowWith - text to replace entire row with on which match is found  
 
alt. 2) Replace column X on row Y with string  
 
Options format: Section, Row, Column, ReplaceWith  
 
Section - settings, machines, batch or data  
 
Row = row number of row to replace  
 
Column = column number of column to replace  
 
ReplaceWith - text to replace old text with  
Special options  
ReplaceWith = "$delete" deletes a row  
ReplaceWith = "$blank" replaces text with an empty string  

Notice: it is meaningless to replace text in the [Data] section on other rows than the first one without the "/alldata" switch  

/undo [Optional parameter]
Runs the undo section     

/alldata [Optional parameter]
When not present, only the first row of the [Data] section is processed - only single item operations are possible.  

Feedback
SetupBatcher sets the %errorlevel% environment variable after each job.

Code
Description
0
Operation successful
1-XXX
Operation failed. Read / type the file "batch.log". If there are errors, any messages from the output window are saved in the file batch.log.


How to debug script files that are executed from the command line
·Use the BatchSettings.Debug setting:  
·Add the row "BatchSettings.Debug=Yes" to the [Settings] section of the script  
·Or add the switch "/r settings,,BatchSettings.Debug=Yes" to the command line  

Command line example
admwin.exe /SB ntacc.cnu /r settings,Account.Password.MustChange,Account.Password.MustChange=Yes /r batch,Account.Set.Group.Global,Account.Set.Group.Global=Users /r data,1,2,MyAccount /r data,1,3,MyPassword      

·Load the file "ntacc.cnu".  
·Replace line in [Settings] where text "Account.Password.MustChange" is found with "Account.Password.MustChange=Yes" .  
·Replace line in [Batch] where text "Account.Set.Group.Global" is found with "Account.Set.Group.Global=Users"  
·Replace row 1, column 2 in [Data] with "MyAccount".  
·Replace row 1, column 3 in [Data] with "MyPassWord".  
·Run the batch job.  

For an example of how to call SetupBatcher from a batch-file, see the file "DOScall.bat" in the AdmWin directory.