KeyBuild supports Batch Mode” where all normal Sounds, Displays and Prompts are suppressed.  This can be used to automate the process of building Keys or building Renew Codes.


Running KeyBuild From Win8 Cmd-Line

In order to run KeyBuild in Batch Mode, a parent program or batch file uses "/B" along with other “Command-Line Options” to specify exactly what will be done.  After the operation is complete, KeyBuild sets a return code so the parent program or batch file can check for success.  In addition, all program activity can be recorded to a Log file for later review.  Each Logged activity is stamped with the local Date and Time so you have a record of exactly what was done and when it was done.


In Batch Mode, all KeyBuild Preferences are ignored.   So, even though your Preferences might be set to only allow Rockey4 Keys to be Built, KeyBuild will Build all Keys that it finds plugged in.  Another example is that you can set Preferences to not “Show Build Warnings”.  Regardless of the setting, any Warnings that occur during the Build process will always be recorded in the KeyBuild Log.


KeyBuild Cmd-Line Help Screen

Except for the “/H” (Help) option, all KeyBuild Command-Line Options are ignored, unless the “/B” (Batch Mode) option is also specified.  You can use the command-line entry "keybuild /H <Enter>" to display the Help screen for all the KeyBuild Command-Line options.


For a complete list of all KeyBuild Command-Line options, refer to this entry.


When using Batch Mode, you must always specify an Options File to use.  Most of the Command-Line Options are used to “override” the options in the specified Options File.  However, while operating in Batch Mode, any overrides or updates to the options will not be saved (like they are during non-Batch operation).


When running KeyBuild in Batch Mode, the parent program or batch file can check to determine if the KeyBuild operation completed successfully.  If running from a Windows Batch file, you would check ERRORLEVEL. If running from a parent program, you would check the completion code of the executed program (KeyBuild).  If the value is set to zero (0), the operation completed successfully.  If not zero, then the value is set to the last three (3) digits of the Error Code.  For example, if KeyBuild failed with Error 6043 because no Keys were found, then the value would be set to 43.  The value will be set to 9 if you specify an unsupported Command-Line option, or the Options File contains a setting that cannot be used, e.g. a Time Limit with an Expiration-Date that has already passed.


KeyBuild Batch Mode Log File

The KeyBuild Log files are easy to read and understand. Most typical Log files represent each activity with a single cryptic line of text.  In the KeyBuild Log files, each program activity consists of a group of lines that is a text representation of what you would normally see when running the program.  Each activity is stamped with the local Date and Time so you have an easy-to-read record of exactly what you did and when you did it.


By default, KeyBuild always records its activity to a Log file. However, this can be disabled with the “Turn Off Logging” setting on the KeyBuild Preferences panel.  If you're using KeyBuild in Batch Mode (“/B” Command-Line option), the “/L” option will override the Preferences panel setting.


The name of the KeyBuild Log file will always be “KeyBuild.log”.  Even though you may not change the name of the Log file, you can always use the “/L” Command-Line Option to specify the path where the Log file will be.  The Log file location for KeyBuild can also be specified by setting the “KeyBuild Log Path” field in the KeyBuild Preferences panel.


For all of the EverKey programs, if a Log file does not already exist in the specified location, a new Log file will be created.  If it does already exist, the new activity will be appended to the end of the file.


When specifying a Log file path, you can use an Absolute Path or a Relative Path. If you specify the “/L” option, but don't specify a path, then that program's path will be used.  For example, if you want your KeyBuild Log file to reside in the same folder as the KeyBuild program, you could set the Windows shortcut “Target” field to “keybuild /L” .


If you use the “/L” option and the specified Log File Path:

  • Is an Invalid Absolute or Relative Path.

  • Refers to a Folder that does not Exist.

  • Refers to a Folder that you do not have Write Access Permission.

Then the program will end with an Error message and it's ERRORLEVEL will be set to 9.


If you run KeyBuild without specifying a “/L” path and you do not have Write Access Permission to the folder where KeyBuild resides, it will display a Warning and continue without using a Log file.