Heaventools

   English English  Deutsch Deutsch  Русский Русский

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. It reads and executes scripts using the Windows Scripting Host engine. RTC uses VBScript as a default scripting language. RTC scripts have an .RTS (meaning Resource Tuner Script) extension. Script files are usually edited in any ASCII text editor.

To give you an idea of how this all works, we tried to cover all possible needs and made a dozen of scripts and test applications. Sample scripts illustrated the main features can be found within the Resource Tuner Console package.


How Does It Work?

Use of Resource Tuner Console typically includes the following steps:

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

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

3Resource Tuner Console will go through the input path of the script, edit the file's resources, and save the modified file to the destination location.

 

Usage

From the command prompt, type rtc.exe.

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 .bat file

Create a .bat file and put rtc.exe /F:ScriptName in it.

Once installed Resorce Tuner Console, you will find the Demo folder in the directory where RTC has been installed. Have a look in there for a few .bat 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, German, Spanish or French, 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!


Placeholder Usage Guidelines

You can use multiple placeholders in your scripts. You can write one generic script and just invoke it with different parameters. Every placeholder in the script body must be enclosed by % signs.

Example:

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

During script execution, the following lines:

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

will be replaced with:

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


Exit Codes

Resource Tuner Console will return an exit code of 0 if the script was successful, 1 if the command line parameters were invalid, 2 if the script file could not be opened, 3 if the script failed, or a syntax error occurred, 4 if the script file name wasn't specified, and 5 if the script file wasn't found.

	
@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 finished 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

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.

 

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