• No results found

Commands Supported by Launch

The commands supported by Launch are detailed below. Square brackets indicate that a parameter is optional. Characters in Italics represent a variable, and not a literal.

Copy

Description

Copies a file but does not overwrite an existing file.

Syntax

Copy,source-file,destination-file

Parameters

source-file: The file to be copied, including its path destination-file: The destination path and filename Example

copy,\Storage Card\MyData.dat,\Temp\MyData.dat Notes

If the destination file already exists, it is not overwritten, and no error is given.

If the source file is blank, a zero-byte file is created.

Delete

source-file: The file to be deleted, including its path Example

Commands Supported by Launch

DelRegData

Description

Deletes a specified registry data field.

Syntax

Delregdata,key,subkey,field

Parameters

key: The abbreviated major registry key where you want to delete a field. Can be one of:

l cr or hkcr (HKEY_CLASSES_ROOT)

l cu or hkcu (HKEY_CURRENT_USER)

l lm or hklm (HKEY_LOCAL_MACHINE).

The case of key doesn’t matter

subkey: The subkey that holds the field you want to delete.

field: The field that you want to delete.

Example

delregdata,LM,Software\WidgetsPlc\OurApp,AppName Notes

An error isn’t displayed if you specify a non-existent field, but is displayed if you specify a non-existent key or subkey.

Commands Supported by Launch

DelRegKey

Description

Deletes a specified registry subkey.

Syntax

DelRegKey,key,subkey

Parameters

key: The abbreviated major registry key where you want to delete the subkey. Can be one of:

l cr or hkcr (HKEY_CLASSES_ROOT)

l cu or hkcu (HKEY_CURRENT_USER)

l lm or hklm (HKEY_LOCAL_MACHINE).

The case of key doesn’t matter subkey: The subkey you want to delete.

Example

delregkey,LM,Software\WidgetsPlc\OurApp Notes

Deletes the specified subkey and all of its contents (if any).

ElseIf

Description

Begins conditional command block, executed only if the previous IF command was FALSE.

Syntax

Results are unpredictable if not paired properly with If… command.

Commands Supported by Launch

ElseIfFIile

Description

Begins conditional command block executed only if the file specified in the previous IfFile does not exist.

Syntax

Results are unpredictable if not paired properly with IfFile command.

EndIf

Description

Ends conditional command block begun with the previous IF command.

Syntax

Results are unpredictable if not paired properly with If… command.

Commands Supported by Launch

EndIfFile

Description

Ends conditional command block begun with the previous IF command.

Syntax

Results are unpredictable if not paired properly with IfFile command.

EndIfTerm

Description

Ends conditional command block executed only if the terminal type specified in IfTerm matches.

Syntax

Results are unpredictable if not paired properly with IfTerm command.

Commands Supported by Launch

FCopy

Description

Copies a file, overwriting any existing file.

Syntax

fcopy,source-file,destination-file

Parameters

source-file: The file to be copied, including its path destination-file: The destination path and filename Example

fcopy,\Storage Card\MyData.dat,\Temp\MyData.dat Notes

If the destination file already exists it is overwritten.

If the source file is blank, a zero-byte file is created.

Commands Supported by Launch

IfFile

Description

Begins the conditional execution of a block of commands only if the specified file exists.

Syntax

IfFile,file Parameters

file: The path and filename to determine if the commands should be executed Example

IfFile,\System\MyData.dat

any number of commands, executed if file exists ElseIfFile

any number of commands, executed if file does not exist EndIfFile

Notes

If the file already exists the commands are executed.

This test does not care if file is a file or directory.

Nesting is supported.

Commands Supported by Launch

IfTerm

Description

Begins the conditional execution of a block of commands only if the terminal matches the specified terminal type.

Syntax

IfTerm,terminal

Parameters

terminal: The terminal type to determine if the commands should be executed Example

IfTerm,MX3X

any number of commands EndIfTerm

Notes

If the terminal type is identical (not case-dependent) the commands are executed.

Nesting withIfFileis supported. Nesting withIfTerm is meaningless.

Launch

program: The full path and filename of the program to be run.

wait-code Tells Launch how to behave when the program is running.

w(ait) causes Launch to stop processing the script until the program has finished executing.

c(ontinue) makes Launch continue processing the script while the program is executing.

Example

launch,\Windows\Calc.exe,w Notes

Commands Supported by Launch

LaunchCmd

Description

Runs a program with arguments.

Syntax

Launchcmd,program,arguments,wait-code

Parameters

program: The full path and filename of the program to be run.

wait-code Tells Launch how to behave when the program is running.

w(ait) causes Launch to stop processing the script until the program has finished executing.

c(ontinue) makes Launch continue processing the script while the program is executing.

arguments: The command line arguments for program.

Example

launchcmd,\Windows\Pword.exe,\My Documents\Doc1.doc,w Notes

This differs from Launch in that LaunchCmd allows parameters.

Message

Description

Displays a message on the screen.

Syntax

Message,message-title,message-body

Parameters

message-title: A heading for the message. Can be left empty.

message-body: The main body of the message. To display a message over multiple lines, use the \n character combination at the end of each line. To display a single backslash use two together (\\).

Example

message,This is a message,"This is the first line,\nand this is the second"

Notes

Displaying a message pauses the execution of the script file until the message is OK’d. This is displayed with a modal dialog.

Commands Supported by Launch

dir: The full path and name of the directory to be created.

Example

mkdir,\Program Files\MyApp Notes

A new directory cannot be created if its parent directory doesn’t exist.

For example, to create a directory called \MyApp with a subdirectory called SubDir1, use mkdir,\MyApp followed by mkdir,\MyApp\SubDir1.

dir: The full path and name of the directory to be removed.

Example

rmdir,\Program Files\MyApp Notes

A directory cannot be removed if it contains files or subdirectories.

Commands Supported by Launch

SetRegData

Description

Adds or updates a data field in the registry.

Syntax

Setregdata,key,subkey,type,field,data[,data2][,data3]...

Parameters

key: The abbreviated major registry key where you want to create/update the subkey. Can be one of:

l cr or hkcr (HKEY_CLASSES_ROOT)

l cu or hkcu (HKEY_CURRENT_USER)

l lm or hklm (HKEY_LOCAL_MACHINE).

The case of key doesn’t matter

subkey: The subkey you want to create/update a field in.

type: The data type of the field you wish to create/update. Can be s (for string value), dd (for decimal value), dx (for hexadecimal value) or b (for binary value). The case of type doesn’t matter. If you’re altering an existing field, type can be different from the current type

field: The name of the new field to be created/updated.

data: The value of the field being created. This depends on the type of field. Binary fields can have many values (up to 2000 bytes). In this case the data field holds the number of bytes in the binary field, and each byte is given as a subsequent parameter in hexadecimal (data2, data3 etc.).

Example

Setregdata,LM,WidgetsPlc\Info,s,AppName,The Widget Program Setregdata,LM,WidgetsPlc\Info,dx,HexField,FA5B

Setregdata,LM,WidgetsPlc\Info,b,5,d3,62,58,f1,9c

Commands Supported by Launch

SetRegKey

Description

Adds a sub key to the registry.

Syntax

Setregkey,key,subkey

Parameters

key: The abbreviated major registry key where you want to create the subkey. Can be one of:

l cr or hkcr (HKEY_CLASSES_ROOT)

l cu or hkcu (HKEY_CURRENT_USER)

l lm or hklm (HKEY_LOCAL_MACHINE).

The case of key doesn’t matter subkey: The subkey you want to create.

Example

Setregkey,LM,Software\MyApp Notes

Attempting to create a key that already exists does not cause an error.

Commands Supported by Launch

name: The path and name of the shortcut file. The file name must end in .lnk for Windows CE to recognize it as a shortcut.

target: The target of the shortcut. If the target has a space in it quote marks must be used (see Command Line Structure section and example below).

Example

shortcut,\Program Files\Widget.lnk,"""\My App\Widget.exe"""

Notes

No validation is performed on target to be sure it is executable.

Warmboot

Related documents