Command Line Processing: Overview

 

RC-WinTrans offers two options for automating processes via a batch processing.  These are the command line tool and Windows scripting.

 

See also:  "Batch Program - Batch File."

 

 

Command Line Tool

RC-WinTrans has a command line tool ("RWTCmd.exe") that provides a set of command line

commands which can be called from the command prompt or, more commonly, from a batch process.

 

The command line tool is a small program which does not execute commands by itself.  The command line tool uses RC-WinTrans as an automation server and it is RC-WinTrans which actually executes the command.

 

A discussion of the command line commands can be found in the "Command Line Commands" topic.

 

Additional information can also be found further on under "Command Line Tool: Basic Usage" and "Migration from Previous Versions of RC-WinTrans" (this topic).

 

 

Windows Scripting

Script files in any language supported by the Windows Scripting Host can be used for command line processing.  Examples of such scripting languages include VBScript, Jscript, PerlScript, etc.

 

A script can make use of RC-WinTrans' extended COM automation interface which offers a wide variety of options for automating processes.

 

See also:  "Scripting: Reference."

 

 

Extendibility

Both types of command line interface- batch and script- can be extended with Visual Basic for Applications (VBA).  This means that the set of available commands can be extended with VBA procedures.

 

If you require an additional command line command, please contact Schaudin.com for information on how to realize it using VBA.

 

 

Samples

RC-WinTrans comes with samples for using the command line tool in batch files and for using Windows scripting.

 

·

Batch File Samples

Directory:

<Install Dir>\RC-WinTrans X8\samples\commandline\batch

Read-me file:

<Install Dir>\RC-WinTrans X8\samples\commandline\ReadMe.htm

 

 

BATCH FILE

DESCRIPTION

1.

"AddLanguage.bat"

Adds a new target language to a translation project.

2.

"CreateProject.bat"

Creates a new translation project and add files (to be translated) to the project.

3.

"UpdateAndWrite.bat"

a.

Verifies that a translation project is up-to-date (no source files have changed).  The project will be updated if there are source files that are not up-to-date.

b.

The target files of the translation project will be written (created).

4.

"WriteTargetFiles.bat"

 

5.

"WriteTgtToDir.bat"

 

 

·

Windows Scripting File Samples

Directory:

<Install Dir>\RC-WinTrans X8\samples\commandline\scripting

Read-me file:

<Install Dir>\RC-WinTrans X8\samples\commandline\ReadMe.htm

 

 

SCRIPTING FILE

DESCRIPTION

1.

"MyJob.wsf"

 + "MyScript.vbs"

 + "RWTComWrapper.vbs"

Checks a translation project for:

a.

changed source files;

b.

missing target files;

c.

target files that are not up-to-date (as compared with the translation database);

d.

target files that are not fully translated.

2.

"UpdateAndWrite.wsf"

 + "RWTComWrapper.vbs"

 

 

 

Command Line Tool: Basic Usage

To use the batch-type command line tool, copy both the "RWTCmd.exe" and "Interop.RC-WinTrans.dll" files to a directory in your search path.  The files can be found in the RC-WinTrans installation directory under "Program\" (e.g., C:\Program Files\RC-WinTrans X8\Program).

 

To write the target files for a given translation project, the corresponding batch code might look something like this:

        RWTCmd /WriteTargetFile myProject.rwtproject file1.rc fr "file1FR.rc"
/KeepAlive
RWTCmd /WriteTargetFile myProject.rwtproject file2.rc fr "file2FR.rc"
/KeepAlive
RWTCmd /WriteTargetFile myProject.rwtproject file3.rc fr "file3FR.rc"

 

For a complete list of commands and switches please refer to the help topic entitled "Command Line Commands."

 

 

Migration from Previous Versions of RC-WinTrans

RC-WinTrans X8's batch command line interface has undergone some minor changes since previous versions.  The most important of these are:

·

User-defined batch functions can be added using VBA macros, i.e., the command line interface is extendable.

·

Language IDs are now specified as ISO 639 language codes, (e.g., "en-us," "es," "jp") (previous versions would expect a 4-digit hex number).

·

Almost all commands use a translation project file name (e.g., "myproject.rwtproject") as the first parameter.

·

There is a parameter called "/KeepAlive" that allows the RC-WinTrans application to keep running between two command calls.

·

A more intuitive rule for return values has been implemented: a non-negative value is used to indicate a successful call while a negative value indicates an error.

·

It is possible to programmatically "kill" a running instance of RC-WinTrans in case of a serious problem.

 

A set of script sample batch files can be found in the RC-WinTrans directory under "Samples" ->
"Commandline" -> "Batch
."

 

 

^ TOP ^