Heaventools

   English English  Deutsch Deutsch

How To Get Started With Resource Tuner Console

Resource Tuner Console is a command-line tool. It's a scriptable program runnable from the console, and is intended to be used from the batch (.bat) files. If you need a visual resource editor with GUI, Resource Tuner GUI is the right product for you.

Resource Tuner Console (RTC) accepts input from a script file. RTC scripts are plain text files and have an .RTS (meaning Resource Tuner Script) extension. Script files are usually edited in any ASCII text editor.

RTC reads and executes scripts using the Windows Script Host engine. Windows Script Host is part of the standard OS installation and so is available on any Windows machine.

RTC uses VBScript as a default scripting language. Any active scripting language installed and supported by Windows Script Host can be used for scripts.


How It Works

Use of Resource Tuner Console typically includes the following steps:

1

The user writes a script for the resource editing operations, following the requirements of the scripting language. Use these examples as templates for your own scripts. For greater detail, see The Step-by-Step Guide To Using RTC Scripts.

1

The user specifies the file names and paths to source and destination locations, and starts up the tool from the batch file.

1

Resource Tuner Console goes through the input path of the script, edits the file's resources, and saves the modified file to the destination location.

 

Usage

When used with no parameters, RTC provides general help for using the command-line interface. From the command prompt, type  rtc.exe to invoke general help.

Resource Tuner Console

Invoking the program from the command prompt

From the command prompt, type  rtc.exe /F:ScriptName (including the full path, if any).

Example:   rtc.exe /F:"c:\temp\my_script.rts"


Running from the batch file

Create a batch file with a .bat extension and put rtc.exe /F:"PathToScriptName" in it.

Batch file examples:

Example 1

rtc /L:"log.txt" /F:"edit_manifest.rts"
 

Example 2

@CLS
@SET CURRENT_DIR="%CD%"
@SET BATH_DIR="%~dp0"
@CD %BATH_DIR% || EXIT 100
@CD .. || EXIT 100
@CD .. || EXIT 100
@SET PATH=%PATH%;%CD%
@CD %BATH_DIR% || EXIT 100

rtc /L:"%~dp0\log.txt" /F:"edit_icons.rts"

@CD %CURRENT_DIR% || EXIT 100
 

Once installed Resorce Tuner Console, you will find the Demo folder nested within the directory where RTC has been installed. Have a look in there for more batch file examples.

Sample Scripts Step-by-Step Guide To Using RTC Scripts


Syntax

RTC [options] /F:ScriptName

Options:

 /S

Silent On.

 /L[:LogName]

Logging On.

 /A

Append Log.

 /plhdXX="Value"

Pass Value using a Placeholder.

 /E

User Language Override.


Parameters

/F:ScriptName
Script File Name. Required. Specifies the name of a script file. By default, the program expects to find the script file under the same directory the program is located if this parameter does not contain a fully qualified pathname. If a file name and/or pathnames contain a space, they must be enclosed in double quotes.


Options

/S
Silent On. Optional. Instructs the program to be silent. No events will be displayed on the screen.

/L[:LogName]
Logging On. Optional. Specifies the name of a log file (including the full path, if any) and causes the program to create a log file detailing all events and actions taken during the editing process. If you suspect a script does not produce the desired results the log file will tell you every little detail. Don't forget to use quotes if the log name contains spaces. If the LogName argument is omitted, the program will use the default RTC.log name and creates a log file in the same directory the program is located. If the /L parameter is omitted, the program will not output to file.

/A
Append Log. Optional. Instructs the program to append a log to the existing log file. If the /A parameter is omitted, the program will overwrite the existing log file.

/E
User Language Override. Optional. Instructs the program to always use English for its output. If the /E parameter is omitted, RTC outputs messages in either English, Dutch, German, Finnish, French, Spanish, Swedish, Japanese, Italian, Korean, Portuguese, Russian, or Polish, depending upon the user's locale.

/plhdXX="Value"
Pass Value. Optional. Instructs the program to find a specified placeholder plhdXX within your script and replace it with the Value, where:

plhd — The reserved word (meaning "placeholder"). Required!
XX — Any id. For example, /PLHD01 or /plhd_MyData
Value — Any value you wish to pass into the script. Quotes are required!


Examples


   Example 1

The following command runs the script and creates a log file named rtc.log by default in the same directory the program is located:

   RTC /L /F:"C:\RTC Folder\my test script.rts"

As shown in the example above, filenames that include spaces must be enclosed in quotes.

In response, Resource Tuner Console displays in details all events and actions taken during the editing process. Any syntax errors and/or errors encountered during compilation will be reported for you to correct.


   Example 2

The following command silently runs the script and creates or appends a log to the existing log file named my logfile.log in the user defined directory:

   RTC /S /L:"D:\logs\my logfile.log" /A /F:"my_script.rts"

As shown in the example above, filenames that include spaces must be enclosed in quotes.

In response, Resource Tuner Console displays no events on the console screen.



Placeholder Usage Guidelines

You can use multiple placeholders in your scripts. You can write one generic script and just invoke it with different parameters.

Example:

rtc /plhd_bool="True" /plhd_str="Hello!" /plhd01="10" /F:"script.rts"

Every placeholder in the script body must be enclosed by % signs. During the script execution, the following placeholders in the script:


MainFlag = %plhd_bool%
HelloStr = "%plhd_str%"
Counter = %plhd01%

will be replaced with the values:


MainFlag = True
HelloStr = "Hello!"
Counter = 10



Exit Codes

Resource Tuner Console returns distinct exit codes to communicate the status of the script execution. Here are the corresponding exit codes and their meanings:

  • Exit Code 0: The script completed successfully.
  • Exit Code 1: Invalid command line parameters were provided.
  • Exit Code 2: The script file could not be opened.
  • Exit Code 3: The script encountered a failure or syntax error during execution.
  • Exit Code 4: The script file name was not specified.
  • Exit Code 5: The script file specified was not found.

Exit Codes Example:
	
@echo off  
start /wait rtc.exe /F:"c:\temp\my_script.rts"

 if errorlevel 0 goto 0
 if errorlevel 1 goto 1
 if errorlevel 2 goto 2
 if errorlevel 3 goto 3
 if errorlevel 4 goto 4
 if errorlevel 5 goto 5
 goto done

 :0
 echo Script completed OK 
 goto done

 :1 
 echo ERROR: Invalid parameters   
 goto done   
 
 :2   
 echo ERROR: Script file could not be opened
 goto done   
  
 :3
 echo ERROR: Script failed

 :4   
 echo ERROR: Script file name not specified
 goto done   
  
 :5
 echo ERROR: Script file not found
    
 :done

 

Download RTC User's Guide

 

Have A Question?

We would love to get your feedback! Your opinion is of great use to us. If you have any questions about Resource Tuner Console, please contact us. We welcome your feature requests, bug reports, suggestions, or comments about our product. This helps us focus our time on features people are really interested in.

Please be sure to check our FAQ section for the answers to the most commonly asked questions.

 

Sample Scripts
 Download Resource Tuner Console and learn how it can make you more productive.