Keyword Reference

KiXtart Command Reference. 6

: 6

; 6

?. 6

BEEP. 6

BIG.. 6

BREAK.. 7

CALL. 7

CD.. 7

CLS. 7

COLOR.. 8

COOKIE1. 8

COPY.. 8

DEBUG.. 9

DEL. 10

DIM... 10

DISPLAY.. 10

DO UNTIL. 10

EXIT.. 11

FLUSHKB.. 11

FOR EACH.. 11

FOR NEXT.. 12

FUNCTION.. 12

GET.. 13

GETS. 14

GLOBAL. 14

GO.. 14

GOSUB.. 14

GOTO.. 15

IF ELSE ENDIF. 15

INCLUDE. 16

MD.. 17

MOVE. 17

PASSWORD.. 17

PLAY.. 18

QUIT.. 18

RD.. 19

REDIM... 19

RETURN.. 19

RUN.. 19

SELECT CASE … ENDSELECT.. 20

SET.. 20

SETL. 21

SETM... 21

SETTIME. 21

SHELL. 22

SLEEP. 22

SMALL. 22

USE. 22

WHILE - LOOP. 23

KiXtart Function Reference. 24

Return Values. 24

Registry Functions. 24

ABS. 25

ADDKEY.. 25

ADDPRINTERCONNECTION.. 25

ADDPROGRAMGROUP. 26

ADDPROGRAMITEM... 26

ASC.. 27

ASCAN.. 27

AT.. 28

BACKUPEVENTLOG.. 29

BOX.. 29

CDBL. 30

CINT.. 30

CLEAREVENTLOG.. 31

CLOSE. 31

COMPAREFILETIMES. 31

CREATEOBJECT.. 32

CSTR.. 32

DECTOHEX.. 32

DELKEY.. 33

DELPRINTERCONNECTION.. 33

DELPROGRAMGROUP. 33

DELPROGRAMITEM... 34

DELTREE. 34

DELVALUE. 34

DIR.. 35

ENUMGROUP. 35

ENUMIPINFO.. 36

ENUMKEY.. 36

ENUMLOCALGROUP. 37

ENUMVALUE. 37

EXECUTE. 38

EXIST.. 38

EXISTKEY.. 39

EXPANDENVIRONMENTVARS. 39

FIX.. 39

FORMATNUMBER.. 39

FREEFILEHANDLE. 40

GETCOMMANDLINE. 40

GETDISKSPACE. 41

GETFILEATTR.. 41

GETFILESIZE. 42

GETFILETIME. 42

GETFILEVERSION.. 43

GETOBJECT.. 44

IIF. 45

INGROUP. 45

INSTR.. 46

INSTRREV.. 46

INT.. 47

ISDECLARED.. 47

JOIN.. 47

KBHIT.. 48

KEYEXIST.. 48

LCASE. 48

LEFT.. 48

LEN.. 49

LOADHIVE. 49

LOADKEY.. 50

LOGEVENT.. 50

LOGOFF. 51

LTRIM... 51

MEMORYSIZE. 51

MESSAGEBOX.. 52

OPEN.. 53

READLINE. 54

READPROFILESTRING.. 55

READTYPE. 55

READVALUE. 56

REDIRECTOUTPUT.. 56

RIGHT.. 57

RND.. 57

ROUND.. 57

RTRIM... 58

SAVEKEY.. 58

SENDKEYS. 58

SENDMESSAGE. 60

SETASCII 61

SETCONSOLE. 61

SETDEFAULTPRINTER.. 62

SETFILEATTR.. 62

SETFOCUS. 63

SETOPTION.. 63

SETSYSTEMSTATE. 64

SETTITLE. 65

SETWALLPAPER.. 65

SHOWPROGRAMGROUP. 65

SHUTDOWN.. 66

SIDTONAME. 67

SPLIT.. 67

SRND.. 68

SUBSTR.. 68

TRIM... 69

UBOUND.. 69

UCASE. 69

UNLOADHIVE. 69

VAL. 70

VARTYPE. 70

VARTYPENAME. 71

WRITELINE. 71

WRITEPROFILESTRING.. 72

WRITEVALUE. 73

KiXtart Macro Reference. 74

@ADDRESS. 74

@BUILD.. 74

@COLOR.. 74

@COMMENT.. 74

@CPU.. 74

@CRLF. 74

@CSD.. 74

@CURDIR.. 74

@DATE. 74

@DAY.. 74

@DOMAIN.. 74

@DOS. 74

@ERROR.. 74

@FULLNAME. 74

@HOMEDIR.. 74

@HOMEDRIVE*. 74

@HOMESHR.. 74

@HOSTNAME. 74

@INWIN.. 74

@IPADDRESSx. 74

@KIX.. 74

@LANROOT.. 74

@LDOMAIN*. 74

@LDRIVE. 74

@LM... 74

@LOGONMODE. 74

@LONGHOMEDIR.. 74

@LSERVER.. 74

@MAXPWAGE. 74

@MDAYNO.. 74

@MHZ.. 74

@MONTHNO.. 75

@MONTH.. 75

@MSECS. 75

@ONWOW64. 75

@PID.. 75

@PRIMARYGROUP*. 75

@PRIV.. 75

@PRODUCTSUITE. 75

@PRODUCTTYPE. 75

@PWAGE. 76

@RAS. 76

@RESULT.. 76

@RSERVER*. 76

@SCRIPTDIR.. 76

@SCRIPTEXE. 76

@SCRIPTNAME. 76

@SERROR.. 76

@SID*. 76

@SITE**. 76

@STARTDIR.. 76

@SYSLANG.. 76

@TICKS. 77

@TIME. 77

@TSSESSION.. 77

@USERID.. 77

@USERLANG.. 77

@WDAYNO.. 77

@WKSTA.. 77

@WUSERID.. 77

@YDAYNO.. 77

@YEAR.. 77


KiXtart Command Reference

KiXtart accepts the commands described in the following sections.

 

 

Note

In this documentation, square brackets ([ ]) indicate optional arguments, and angle brackets (< >) indicate required arguments.

 

:

Action

Defines a label within the script file to which you can transfer control.

 

Syntax

:label

 

Remarks

Labels must be unique within a script or user defined function and cannot contain whitespace characters. Labels can be defined inside script segments (for example inside a WHILE – LOOP segment), but you cannot jump to such a label from outside the segment.
Also, labels in INCLUDE files are only allowed inside user-defined functions.

 

 

;

Action

Indicates a comment. Subsequent characters on the script line are ignored.

 

Syntax

;

 

 

See also

Block Commenting.

 

 

 

?

Action

Indicates a new line. This moves the cursor position to the beginning of the next line.

 

Syntax

?

 

 

BEEP

Action

Plays the default sound.

 

Syntax

BEEP

 

BIG

Action

Changes the character mode to large characters.

 

Syntax

BIG

 

Remarks

When BIG is used, subsequent screen output is 8 characters wide and 8 characters high. Use SMALL to reset the character mode to normal.

BIG is ignored when screen output is redirected to a file.

 

BREAK

Action

Enables (BREAK ON) or disables (BREAK OFF) the ctrl+c/break keys and the Close command. This effectively allows control over whether a script run by KiXtart can be interrupted or not.

Syntax

BREAK <ON | OFF>

 

Remarks

By default, to prevent users from inadvertently interrupting a script, KiXtart automatically disables the ctrl+c/break keys, removes the Close command in the System menu of the current command-prompt window, and hides the Please wait while your logon script executes message box on Windows 9x.

 

In a multi-tasking environment such as Windows NT, users cannot be fully prevented from interrupting a program. (Programs can be stopped by using the Task List, for example.) As an additional protection, on computers running Windows NT Workstation only, when BREAK is OFF (the default) KiXtart also installs a special event handler for the current console. The effect of this handler is that whenever a user forcibly terminates KiXtart, the user is automatically logged off. This also means that you must be careful when testing scripts.

 

CALL

Action

Runs a separate KiXtart script.

 

Syntax

CALL "script name"

 

Remarks

When the called script ends or when a RETURN statement is encountered, script execution continues at the statement following the CALL statement in the calling script.

 

Theoretically, there is no limit to the number of scripts that can be nested. Obviously, the practical limit on the number of scripts you can call is determined by the amount of available memory at the time KiXtart runs, the size of the scripts, the number of variables defined, and so on.

 

Note that CALL cannot be used to run tokenized files have been protected with a password.

 

CD

Action

Changes the current working directory to the directory specified.

 

Syntax

CD "directory"

 

Remarks

Check the value of @ERROR to see if CD was successful.

 

CLS

Action

Clears the screen and moves the cursor to position 0,0.

 

Syntax

CLS

 

Remarks

The CLS command is ignored if all output has been redirected to a file using the REDIRECTOUTPUT function.

 

COLOR

Action

Sets the color attribute to be used in subsequent display statements.

 

Syntax

COLOR Xx/Yy

 

Parameters

X

Foreground color

x

Optional intensity indication

Y

Background color

y

Optional blink indication

 

Colour codes:

Character

Low intensity

 

High intensity

 

N

Black

 

Dark grey

 

B

Dark blue

 

Light blue

 

G

Dark green

 

Light green

 

C

Dark cyan

 

Light cyan

 

R

Dark red

 

Light red

 

M

Magenta

 

Pink

 

Y

Brown

 

Yellow

 

W

Light grey

 

White

 

 

Remarks

If the foreground color is followed by a plus sign (+), the color is displayed with high intensity.

 

Specifying a plus sign (+) with the background color causes the color to be displayed blinking.

 

Examples

COLOR w+/b

Bright white text on a blue background

COLOR g/r

Green text on a red background

$ForeGround = "y+"

$BackGround = "n"

COLOR $ForeGround/$BackGround

 

 

Bright yellow text on a black background

$NewColor = "b+/g"

COLOR $NewColor

 

Bright blue text on a green background

 

COOKIE1

Action

Creates a cookie, or semaphore-file, that the Windows 9x Logon API uses to determine whether the script has finished running. This command is only useful when KiXtart is being used to emulate Lmscript.exe. For more information, see "Lmscript Emulation," earlier in this document.

 

Syntax

COOKIE1