script [path]filename.ext arg1 arg2 arg3 arg4
executable arg1 arg2 arg3 arg4
command para1,para2,para3,para4,para5,para6
Program Execution commands: start or ! program,flag,xy,wh,title start an external program note (1) (2) dos command,flag,xy,wh,title execute a dos command note (1) (2) wait windowtitle,timeout wait for a window to open note (1) (2) while windowtitle wait for a window to close note (1) sendkey windowtitle,textstring send keystrokes to a window sendmsg destination,message send a message to another PC note (1) (2) User Interface & Information Display commands: msgbox title,msg,btns,style,margin display a message box note (1) (4) filebox title,localvar,template,dir display a file selection box note (1) (4) dirbox text,localvar,root display a directory selection box note (1) (4) editbox title,message,localvar,preset,xy,wh display an edit box for text entry note (1) (4) (6) passbox title,message,localvar,preset,xy,wh display a password box for password entry note (1) (4) (6) infobox title,filespec,xy,wh load and display a text file note (1) menubox title,message,text,xy,wh display a menu box note (1) (4) listbox title,msg,text,localvar,xy,wh display a list box note (1) (4) radbox title,message,text,xy,wh display a radio button box note (1) (4) tickbox title,message,text,xy,wh display a tick box note (1) (4) numbox title,msg,localvar,preset,xy,wh display a numeric entry box note (1) (4) chrbox title,msg,localvar,preset,xy,wh display a character entry box note (1) (4)) calbox title,msg,localvar,range,xy,wh display a calendar box note (1) (4) ipbox title,msg,localvar,preset,xy,wh display an IP address entry box note (1) (4) timebox title,msg,localvar,preset,xy,wh display a time entry box note (1) (4) datebox title,msg,localvar,preset,xy,wh display a date entry box note (1) (4) picbox title,msg,file, type,xy,wh display a bitmap, or icon note (1) (3) console title,text,flags,xy,wh,localvar display text in a scrollable console note (1) (4) conoff removes a console banner text,xy,wh,b,flags display a banner panel note (1) banoff remove a banner panel progress title,text,value,xy,wh display a progress indicator note (1) progoff remove a progress indicator setfont fontname,size,attribute set font for user interface boxes note (1) getfont localvar1,localvar2,localvar3 get font for user interface boxes Local Variable commands: setvar localvar,value set the value of a local variable note (1) incvar localvar,value increments a local variable by value note (1) addvar localvar,value adds value to a local variable note (1) decvar localvar,value decrements a local variable by value note (1) subvar localvar,value subtracts value from a local variable note (1) mulvar localvar,value multiplies a local variable by value note (1) divvar localvar,value divides a local variable by value note (1) convar localvar,base1,base2 converts a local variable from number base1 to base2 note (1) andvar localvar,value,base logical bitwise AND a local variable by value note (1) orvar localvar,value,base logical bitwise OR a local variable by value note (1) xorvar localvar,value,base logical bitwise XOR a local variable by value note (1) notvar localvar,value,base logical bitwise NOT a local variable note (1) upvar localvar converts a local variable to uppercase lovar localvar converts a local variable to lowercase trimvar localvar,flag trims left and right whitespace and optionally brackets from a local variable ltrmvar localvar trims left whitespace from a local variable rtrmvar localvar trims right whitespace from a local variable appvar localvar,value appends value to a local variable note (1) textvar localvar,type,flag converts HTML or RTF in a local variable to text note (1) formvar localvar,tabs,char,flag formats text in a local variable to the specified tab stops note (1) execute localvar execute the script command contained in local var String commands: findstr text,localvar returns first line in string to a local variable note (1) (2) nextstr text,localvar returns next line in a string to a local variable note (1) (2) lenstr text,localvar returns length of text in local variable note (1) substr text,pos,length,localvar returns substring in text to local variable note (1) srchstr text,string,localvar returns position of string in text to local var note (1) (2) spltstr text,char,localvar1,localvar2 split text at char and return each half to local vars note (1) (2) scanstr text,char,num,localvar returns n-th token from text to local var note (1) (2) sortstr text,char,localvar,flag sorts text delimited by char and returns to local var note (1) (2) replstr text,string,pos,localvar replaces text at pos with string and stores in local var note (1) insrtstr text,string,pos,localvar inserts string in text at pos and stores in local var note (1) grepstr text,chr,repchr,localvar,num replaces char in text with repchr and stores in local var note (1) delstr text,pos,length,localvar deletes from text at pos of length and stores in local var note (1) parspath text,var1,var2,var3,var4,var5 parses text for a valid path name and stores in local vars note (1) parsip text,var1,var2,var3,var4 parses text for a valid IP address and stores in local vars note (1) parsdate text,var1,var2,var3 parses text for a valid date and stores in local vars note (1) parstime text,var1,var2,var3 parses text for a valid time and stores in local vars note (1) Byte manipulation commands: srchbyte localvar1,byte,localvar2 searches for given byte and returns position index in localvar2 note (1) replbyte localvar1,pos,num,localvar2 replaces num bytes in localvar1 at pos using bytes from localvar2 note (1) fillbyte localvar,byte,pos,num fills num bytes in localvar1 at pos with the specified byte note (1) getbyte localvar1,pos,num,localvar2 gets num bytes in localvar1 at pos and copies them to localvar2 note (1) conbyte localvar, flag converts between value in localvar between byte and hexadecimal string note (1) grepbyte localvar,byte1,byte2,num,size replaces num occurrences of specified byte in localvar1 note (1) Environment Variable commands: getenv localvar,envvar get an environment variable note (1) putenv envvar,value store an environment variable note (1) File Association commands: getassoc ext,localvar1,cmdtype,localvar2 get a file association and command note (1) (2) setassoc ext,filetype,cmdtype,command set a file association and command note (1) (2) delassoc ext deletes a file association and all associated commands note (1) (2) fndassoc localvar finds the first registered file association note (1) (2) nxtassoc localvar finds the next file association note (1) (2) File commands: copyfile source,destination,flag copies a file or files note (1) (2) (6) movefile source,destination moves or renames a file note (1) (2) (6) readdata filename,localvar1,flag,localvar2,localvar3 reads first data block from a file to a local variable note (1) (2) nextdata filename,localvar,flag,localvar2 reads next data block from a file to a local variable note (1) (2) readline filename,localvar reads a line from a file to a local variable note (1) (2) nextline filename,localvar reads next line from a file to a local variable note (1) (2) savetext text,filename,flag saves text to a file note (1) (2) savedata data,filename,flag,localvar1,localvar2 saves data to a file note (1) (2) sortfile source,destination,col,flag saves text to a file note (1) (2) delfile filename deletes a file note (1) (2) (6) findfile pathname,localvar returns first file matching pathname note (1) (2) nextfile localvar returns next matching file note (2) filetime filename,localvar,time,flag returns file times to a local variable note (1) setftd filename,date,time,flag sets the file date and time note (1) filesize filename,localvar returns file size to a local variable note (1) getattr filename,localvar,flag returns file attributes to a local variable note (1) setattr filename,attr sets file attributes note (1) filesrch filename,text,localvar,flag returns first instance of text to a local variable note (1) (2) nextsrch filename,text,localvar,flag returns next instance of text to a local variable note (1) (2) filescan filename,text,localvar,flag returns number of occurrences of text to a local variable note (1) (2) Directory commands: setdir dirname sets the current directory note (1) (2) getdir localvar gets current dir to a local var makedir dirname creates a directory note (1) (2) deldir dirname deletes an empty directory note (1) (2) Disk commands: getdisk localvar gets current drive to a local var note (2) finddisk localvar copies first installed drive letter to a local variable note (2) nextdisk localvar copies next installed drive letter to a local variable note (2) disksize disk,localvar copies total disk size in bytes to local variable note (1) diskfree disk,localvar copies disk free size in bytes to local variable note (1) diskused disk,localvar copies disk used size in bytes to local variable note (1) disktype drive,localvar,flag gets info about a disk to a local var note (1) (2) load drive load media into drive letter specified note (1) eject drive eject media from drive letter specified note (1) Registry commands: setreg keyvalue,type,data saves data to a registry key value note (1) (2) getreg keyvalue,localvar gets data from a key value to a local var note [1] (2) delreg keyvalue deletes a key value note (1) (2) findreg key,localvar finds the first value of a registry key note (1) (2) nextreg key,localvar finds the next value of a registry key branch note (1) (2) makekey key creates a registry key note (1) (2) delkey key deletes a registry key note (1) (2) findkey key,localvar finds the first subkey of a registry key note (1) (2) nextkey key,localvar finds the next subkey of a registry key note (1) (2) Printing commands: file print a file on the default printer using wordpad note (1) (2) getprint localvar copies default printer name to local variable setprint printer sets default printer to name specified note (1) findprnt localvar copies name of first printer to local variable note (2) nextprnt localvar copies name of next printer to local variable note (2) Multimedia commands: open device,source,flag open a sound file or cd audio note (1) (2) seek device,position move to a position note (1) (2) play device,position play sound file or CD note (1) (2) pause device pause play note (1) (2) resume device resume play note (1) (2) stop device stop play note (1) (2) getmedia device,localvar,flag copy media info to a local variable note (1) (2) Shortcut commands: makelink linkname,filename,flag create a shortcut note (1) (2) getlink linkname,localvar,info get info about a shortcut note (1) (2) setlink linkname,info,value set info about a shortcut note (1) (2) System Tray commands: puttray text,label,icon,click put an icon in the system tray note (1) (2) modtray text,label,icon,click modify an icon in the system tray note (1) (2) deltray delete script icon from system tray note (2) Clipboard commands: getclip localvar,flag get text from the clipboard note (1) (2) setclip data,flag copy text to the clipboard note (1) clrclip clear the clipboard note (2) Internet commands: geturl url,localvar get text from an internet url note (1) (2) ping host,timeout,size,ttl ping a host computer note (1) (2) Execution control commands: goto label unconditional branch note (1) gosub label branch to a subroutine note (1) return return from a subroutine casemsg labels branch to label corresponding to button pressed note (1) [5] ifmsg button,label branch if message box button pressed note (1) [5] ifnmsg button,label branch if message box button not pressed note (1) [5] iferror label branch if error (start, dos, wait etc.) note (1) [3] ifnerror label branch if not error note (1) [3] ifbit localvar,bit,label branch if bit set in local variable note (1) ifnbit localvar,bit,label branch if bit clear in local variable note (1) ifexist filename,label branch if file exists note (1) ifnexist filename,label branch if file does not exist note (1) ifvar localvar,value,label branch if local variable same as value note (1) ifnvar localvar,value,label branch if local variable not same as value note (1) ifevar localvar,value,label branch if local variable same as integer value note (1) ifgvar localvar,value,label branch if local variable greater than integer value note (1) iflvar localvar,value,label branch if local variable less than integer value note (1) casevar localvar,values,labels branch to label corresponding to value of local variable note (1) Windows Information commands: getname localvar copies computer name to local variable getuser localvar copies user name to local variable gettime localvar,flag,format copies system time to local variable note (1) getdate localvar,flag,format copies system date to local variable note (1) settime hour,min,sec sets the system time note (1) setdate day,mth,year sets the system date note (1) rawdate date,time,localvar converts date and time to raw date note (1) winver localvar,flag copies windows version to local variable windir localvar copies windows directory to local variable sysdir localvar copies system directory to local variable specdir folder,localvar copies directory path of special folder to local variable note (1) memsize localvar copies memory size in Mbytes to local variable getscrnx localvar copies screen width to local variable getscrny localvar copies screen height to local variable Windows Control commands: setscrn width,height,depth sets screen width, height and colour depth note (1) logoff flag logoff the user note (2) shutdown flag shutdown the system note (2) poweroff flag shutdown and power off the system note (2) restart flag restart the system note (2) scrnsave invokes configured screen saver lockpc locks the PC (Win 2000) activate windowtitle bring a window to the foreground note (1) minimise windowtitle minimise a window to the taskbar note (1) maximise windowtitle maximise a window to full screen note (1) restore windowtitle restore a window to normal display note (1) flash windowtitle flashes a window note (1) getwind localvar returns the window title of the active window note (1) close windowtitle closes a window note (1) destroy windowtitle force closes a window note (1) setdesk filename sets desktop wallpaper to filename note (1) setbgnd red,grn,blu sets screen background colour note (1) General commands: delay number delay for a set period note (1) suspend hh:mm:ss,DD/MM/YYYY suspend until specified time and date note (1) idle idle indefinitely quit quit the script immediately beep value play a beep or system sound note (1) random value,localvar generate a random number note (1) Script related commands: report flag report script errors step flag show each command before it is executed debug flag control display of debug messages note (1) dbgbox message show a message for debugging controlled by debug flag note (1) version localvar copies script version to local variable compile script,executable,flag compiles the script specified to a standalone file note (1) priority level sets execution priority note (1) varsize size sets the size of script internal variables note (1) inseq flag guarantees script commands executed in sequence note (1)
(1) these commands allow substitution for command line parameters and local variables (2) these commands set internal error flag if error occurs - test using iferror, ifnerror (3) these commands check the state of the internal error flag (4) these commands return a message value - access using %M, test using casemsg, ifmsg, ifnmsg (5) these commands check the state of the message value (6) these commands return a count value - access using %N
Char Description Meaning @ Alt Character following is alt-char ^ Control Character following is a control character \n newline line feed or enter (0Ah) \r return carriage return or ctrl-enter (0Dh) \t tab tab character (09h) \[ esc escape character (1Bh) \> right cursor right arrow \< left cursor left arrow \^ up cursor up arrow \v down cursor down arrow \h home cursor home key \e end cursor end key \u pgup cursor page up key \d pgdn cursor page down key \, comma Must be escaped or will be interpreted as a separator \\ backslash Must be escaped or will be interpreted as an escape \? question mark Must be escaped or will be interpreted as a wildcard \* asterisk Must be escaped or will be interpreted as a wildcard \$ dollar sign Must be escaped or will be interpreted as a function key \# hash sign Must be escaped or will be interpreted as a hex preamble \% percent sign Must be escaped or will be interpreted as a local variable
; ; Example of a FOR programming construct ; ; Local variables used as follows: ; A = for loop counter ; B = end point ; report on ;priority low debug off setvar A,1 setvar B,5 :startFOR ifgvar B,%A,continue ; ; body of FOR goes here ; banner A = %A delay 10 ; incvar A goto startFOR :continue msgbox FOR example,Finished,0
; ; Example of a WHILE programming construct ; ; Local variables used as follows: ; A = while exit flag ; report on ;priority low debug off setvar A,0 :startWHILE ifnvar A,0,continue ; ; body of WHILE goes here ; banner In WHILE delay 30 banner Now exiting delay 10 setvar A,1 goto startWHILE :continue msgbox WHILE example,Finished,0
; ; Example of a REPEAT programming construct ; ; Local variables used as follows: ; A = repeat exit flag ; report on ;priority low debug off setvar A,0 :startREPEAT ; ; body of REPEAT goes here ; banner In REPEAT delay 30 banner Now exiting delay 10 setvar A,1 ifvar A,0,startREPEAT :continue msgbox REPEAT example,Finished,0
max causes the window to open normally (default). min causes the window to open minimized (an icon). x|y sets the x and y offset from the top lefthand corner of the screen w|h sets the width and height of the displayed window. title sets the title of the window (where possible).
syntax:
start program [parameters][,flag,xy,wh,title]
example:
start c:\windows\notepad.exe,,30|30,500|300
start command.com /c h:\temp\test.bat,min
start cmd.exe /c h:\temp\test.bat,min (WinNT/2000 only)
syntax:
dos command [parameters][,flag],x|y,,title
example:
dos copy test.txt test2.txt
syntax:
wait windowtitle[,timeout]
example:
wait readme.txt - Notepad
wait Microsoft Word - Document1,100
syntax:
while windowtitle
example:
while Untitled - Notepad
syntax:
sendkey windowtitle,textstring
example:
sendkey readme - Notepad,This is a line`\r\n`and this is the second line
sendkey readme - Notepad,`@Fx`
syntax:
sendmsg destination,textstring
example:
sendmsg 192.168.0.1,The coffee is ready
Type Control Value Button OK 0 OK, Cancel 1 Abort, Retry, Ignore 2 Yes, No, Cancel 3 Yes, No 4 Retry, Cancel 5 Cancel, Try Again, Continue 6 Icon STOP or ERROR 16 QUESTION MARK 32 EXCLAMATION or WARNING 48 INFORMATION 64 (USER ICON 128) Default BUTTON1 0 BUTTON2 256 BUTTON3 512 BUTTON4 768 Mode APPLMODAL 0 SYSTEMMODAL 4096 TASKMODAL 8192 HELP BUTTON 16384
Button Value OK 1 CANCEL 2 ABORT 3 RETRY 4 IGNORE 5 YES 6 NO 7 TRY AGAIN 10 CONTINUE 11
syntax:
msgbox [title,]message[,buttons][,style][,margin]
example:
msgbox this is a test,3
msgbox .Please note:,This is a test\nLine 2\nLine 3,3,C,10
syntax:
filebox title,localvar,template,dir
example:
filebox Open Doc File,A,Doc files|*.doc,c:\My Documents
filebox Open File,A,Doc files|*.doc|All files|*.*,c:\My Documents
filebox Open Script,A,Script files|*.scf;*.script|All files|*.*,c:\script
Value Description ALLP(ROGRAMS) Program folder for all users ALLS(TARTMENU) Start menu folder for all users DE(SKTOP) Desktop folder DR(IVES) Drives folder N(ETWORK) Network folder P(ROGRAMS) Programs folder S(TARTMENU) Start menu folder
syntax:
dirbox text,localvar,root
example:
dirbox Select the installation folder,A,drives
syntax:
editbox title,prompt,localvar,preset,x|y,w|h
example:
editbox Text Entry,Enter a name,A
editbox Text Entry,Enter a name,A,20|initial text,L|C,300|100
syntax:
passbox title,prompt,localvar,x|y,w|h
example:
passbox Text Entry,Enter a name,A
passbox Text Entry,Enter a name,A,20|secret password,L|C,300|100
syntax:
infobox Title,filespec,x|y,w|h
example:
infobox PLEASE NOTE,readme.txt
infobox PLEASE NOTE,readme.txt,10|10,400|300
syntax:
menubox Title,Message,Text1|Text2|...|Text7,x|y,w|h
example:
menubox Process document,Please select a document type:,Txt|Rtf|Doc
casemsg exit|doTxt|doRtf|doDoc
syntax:
listbox Title,Message,Text1|Text2|...|TextN,localvar,x|y,w|h
example:
listbox Process document,Please select a document type:,Txt|Rtf|Doc,A
syntax:
radbox Title,Message,Text1|Text2|...|Text7,x|y,w|h
example:
radbox Process document,Please select a document type:,Txt|Rtf|Doc
casemsg exit|doTxt|doRtf|doDoc
syntax:
tickbox Title,Message,Text1|Text2|...|Text7,x|y,w|h
example:
tickbox Options,Please select required options:,Show hidden files|Show system files|Show read only files
ifvar M,0,doRest
setvar A,%M
:checkHidden
ifnbit A,0,checkSystem
;
;processing for hidden files
;
:checkSystem
ifnbit A,1,checkReadOnly
;
;processing for system files
;
:checkReadOnly
ifnbit A,2,doRest
;
;processing for read only files
;
:doRest
syntax:
numbox Title,Message,localvar,preset,x|y,w|h
example:
numbox Numeric entry,Please enter a value:,0|50|100,A
syntax:
chrbox Title,Message,localvar,preset,x|y,w|h
example:
chrbox Character entry,Please enter a drive letter:,A,A
syntax:
calbox Title,Message,localvar,range,x|y,w|h
example:
calbox Date Selection,Please select a day:,A,1
calbox Date Selection,Please select the required date range:,A,7,L|T
Letter Description E Entry by typing into the edit box only. The spin control is disabled S Entry via the spin control only. Typing into the edit control is disabled D No entry allowed. Both typing and spin control are disabled
syntax:
IPbox Title,Message,localvar,preset,x|y,w|h
example:
IPbox IP Address entry,Please enter an address:,A,10.0.0.1,100|100
Letter Description E Entry by typing into the edit box only. The spin control is disabled S Entry via the spin control only. Typing into the edit control is disabled D No entry allowed. Both typing and spin control are disabled
syntax:
timebox Title,Message,localvar,preset,x|y,w|h
example:
timebox Time entry,Please enter a value:,A,10:30:00,100|100
Letter Description E Entry by typing into the edit box only. The spin control is disabled S Entry via the spin control only. Typing into the edit control is disabled D No entry allowed. Both typing and spin control are disabled
syntax:
datebox Title,Message,localvar,preset,x|y,w|h
example:
datebox Date entry,Please enter a value:,A,10/4/2000,100|100
Type Description B Bitmap file I Icon file
syntax:
picbox Title,Message,file, type,x|y,w|h
example:
picbox Picture,View of entry hall,hall.bmp,B,100|100
Flag Description C Clear previous text in console E Allow text in console to be edited Q Quit the script when console is closed W Wait in console until console is closed
syntax:
console title,text,flags,x|y,w|h,localvar
example:
console Backup progress,Starting backup
delay 50
conoff
Flag Description A sets the banner to always on top T aligns text to the top of the banner L aligns text to the left of the banner C aligns text to the centre of the banner (default) R aligns text to the right of the banner
syntax:
banner text,x|y,w|h,b,flags
example:
banner Loading - please wait....
delay 50
banoff
banner Now is the time for all good people to come to the aid of the party,R|T,,10,A|T|L
msgbox Message,Press OK to clear banner,0
banoff
syntax:
progress title,text,size,x|y,w|h
example:
progress Progress Meter, Loading\, please wait....,20,10|10
delay 50
banoff
User Box Description EditBox Text entry area PassBox Password entry area InfoBox Text display area ListBox List entries NumBox Number entry area Console Console display text Banner Banner text
Attribute Description T Thin text B Bold text H Heavy bold I Italics U Underlined S Strikeout
syntax:
setfont fontname,size,attributes
example:
setfont Arial,10,B|U
syntax:
getfont localvar1,localvar2,localvar3
example:
getfont A,B,C
syntax:
setvar localvar,value
example:
setvar A,test 1 2 3
syntax:
incvar localvar,value
addvar localvar,value
example:
setvar A,0
incvar A
incvar A,10
incvar A,%B
syntax:
decvar localvar,value
subvar localvar,value
example:
setvar A,0
decvar A
decvar A,10
decvar A,%B
syntax:
mulvar localvar,value
example:
setvar A,0
mulvar A,10
mulvar A,%B
syntax:
divvar localvar,value
example:
setvar A,100
divvar A,10
divvar A,%B
Base Description B(IN) Binary D(EC) Decimal H(EX) Hexadecimal O(CT) Octal
syntax:
convar localvar,base1,base2
example:
convar A,HEX,BIN
convar A,OCT
convar A,,HEX
Base Description B(IN) Binary D(EC) Decimal H(EX) Hexadecimal O(CT) Octal
syntax:
andvar localvar,value,base
example:
setvar A,100
andvar A,10
andvar A,1F,HEX
andvar A,17,OCT
andvar A,10110011,BIN
andvar A,%B
Base Description B(IN) Binary D(EC) Decimal H(EX) Hexadecimal O(CT) Octal
syntax:
orvar localvar,value,base
example:
setvar A,100
orvar A,10
orvar A,1F,HEX
orvar A,17,OCT
orvar A,10110011,BIN
orvar A,%B
Base Description B(IN) Binary D(EC) Decimal H(EX) Hexadecimal O(CT) Octal
syntax:
xorvar localvar,value,base
example:
setvar A,100
xorvar A,10
xorvar A,1F,HEX
xorvar A,17,OCT
xorvar A,10110011,BIN
xorvar A,%B
Base Description B(IN) Binary D(EC) Decimal H(EX) Hexadecimal O(CT) Octal
syntax:
notvar localvar,base
example:
setvar A,100
notvar A,10
notvar A,1F,HEX
notvar A,17,OCT
notvar A,10110011,BIN
notvar A,%B
syntax:
upvar localvar
example:
setvar A,test
upvar A
syntax:
lovar localvar
example:
setvar A,TEST
lovar A
syntax:
trimvar localvar
example:
setvar A,` TEST `
trimvar A
syntax:
ltrmvar localvar
example:
setvar A,` TEST`
ltrmvar A
syntax:
rtrmvar localvar
example:
setvar A,`TEST `
rtrmvar A
syntax:
appvar localvar,value
example:
appvar A,test 1 2 3
appvar A,%B
syntax:
textvar localvar,type,flag
example:
textvar A,RTF
textvar B,HTML,C
Tab Description nn single tab at column nn n1|n2|n3 tabs at columns n1, n2 and n3 nn! tab stops every nn columns (blank) tab stops every 8 columns
syntax:
formvar localvar,tabs,char,flag
example:
formvar A
formvar B,10!,,T
formvar B,10|30|45,$,T
syntax:
execute localvar
example:
execute A
syntax:
findstr text,localvar
example:
findstr %A,B
syntax:
nextstr text,localvar
example:
nextstr %A,B
syntax:
lenstr text,localvar
example:
lenstr This is a test,B
lenstr %A,B
syntax:
substr text,start,length,localvar
example:
substr This is a test,6,4,B
substr %A,%B,5,C
syntax:
srchstr text,string,localvar
example:
srchstr This is a test,is,B
srchstr %A,%B,C
syntax:
spltstr text,char,localvar1,localvar2
example:
spltstr This is a test,e,A,B
spltstr %A,%B,C,D
syntax:
scanstr text,char,num,localvar
example:
srchstr This is a test,i,2,A
srchstr %A,%B,%C,D
Flag Description TA Text ascending, case sensitive TD Text descending, case sensitive UA Text ascending, case insensitive UD Text descending, case insensitive NA Numeric ascending ND Numeric descending
syntax:
sortstr text,char,localvar,flag
example:
sortstr banana apple egg drink cherry, ,A,TD
sortstr %A,%B,C
syntax:
replstr text,string,pos,localvar
example:
replstr This is a test,joke,11,B
replstr %A,%B,%C,D
syntax:
insrtstr text,string,pos,localvar
example:
insrtstr This is a test,really good,11,B
insrtstr %A,%B,%C,D
syntax:
grepstr text,char,repchr,localvar,num
example:
grepstr aaabacadaeafagaaa,a,x,B,5
syntax:
delstr text,pos,length,localvar
example:
delstr This is a really good test,11,12,B
delstr %A,%B,%C,D
syntax:
parspath text,var1,var2,var3,var4,var5
example:
parspath c:\windows\media\chimes.wav,A,B,C,D
parspath \\server\c\test.txt,A,,B
parspath c:\windows\media\chimes.wav,A,B,C,D
syntax:
parsip text,var1,var2,var3,var4
example:
parsip 10.0.0.1,A,B,C,D
syntax:
parsdate text,var1,var2,var3
example:
parsdate 23/4/2001,A,B,C
syntax:
parstime text,var1,var2,var3
example:
parstime 10:15:35,A,B,C
syntax:
srchbyte localvar1,byte,localvar2
example:
srchbyte A,$,B
syntax:
replbyte localvar1,pos,num,localvar2
example:
replbyte A,4,6,B
syntax:
fillbyte localvar1,byte,pos,num
example:
fillbyte A,0,6,1
syntax:
getbyte localvar1,pos,num,localvar2
example:
getbyte A,3,5,B
Flag Description S(TR) convert byte value to a decimal string B(YTE) convert decimal string to a byte
syntax:
conbyte localvar1,flag
example:
conbyte A,s
syntax:
grepbyte localvar,byte1,byte2,num,size
example:
fillbyte A,0,6,1
syntax:
getenv localvar,envvar
example:
getenv A,TEMP
syntax:
putenv envvar,value
example:
putenv TEMP,c:\temp
putenv TEMP,
syntax:
getassoc ext,localvar1,cmdtype,localvar2
example:
getassoc .txt,A,open,B
syntax:
setassoc ext,filetype,cmdtype,command
example:
setassoc .txt,txtfile,open,notepad.exe
syntax:
delassoc ext,filetype
example:
delassoc .txt
syntax:
fndassoc locavar
example:
fndassoc A
syntax:
nxtassoc locavar
example:
nxtassoc A
syntax:
copyfile source,destination[,flag]
example:
copyfile test1.txt,test2,YES
copyfile c:\dir1\*.txt,c:\dir2,NEW
syntax:
movefile source,destination
example:
movefile temp.txt,test.txt
movefile c:\temp\test.txt,c:\files\test.txt
movefile c:\temp\temp.txt,c:\files\test.txt
syntax:
readdata source,localvar,flag,localvar2,localvar3
example:
readdata test1.txt,A
readdata test1.txt,A,E
syntax:
nextdata source,localvar,flag,localvar2
example:
nextdata test1.txt,A
nextdata test1.txt,A,E
syntax:
readline filename,localvar,linenum
example:
readline test1.txt,A
readline test1.txt,A,8
syntax:
nextline filename,localvar
example:
nextline test1.txt,A
syntax:
savetext text,destination,flag
example:
savetext This is some text,test.txt
savetext Line1\r\nLine2\r\nLine3,test.txt
savetext %A,test.txt,A
Flag Description C Create a new file, erasing any previous file of that name (default) A Append data to the end of the file O Overwrite the previous data in the file
syntax:
savedata parameter,destination,flag,localvar1,localvar2
example:
savedata This is some data,test.txt,,17
savedata %A,test.txt,A,256
Flag Description TA Text ascending, case sensitive TD Text descending, case sensitive UA Text ascending, case insensitive UD Text descending, case insensitive NA Numeric ascending ND Numeric descending
syntax:
sortfile source,destination,column,flag
example:
sortfile input.txt,output.txt
sortfile input.txt,output.txt,5,NA
syntax:
delfile name
example:
delfile test1.txt
delfile c:\temp
syntax:
findfile pathname,localvar
example:
findfile c:\temp\*.*,A
syntax:
nextfile localvar
example:
nextfile A
info Description A Last Access Time C Creation time W Last write time
flag Description R(AW) Raw elapsed file time T(IME) Time in hh:mm:ss format DAT(E) Date in dd/mm/yyyy format H(OUR) Hours MIN Minutes S(EC) Seconds DAY Day of month W(DAY) Day of week MON Month Y(EAR) Year
syntax:
filetime filename,localvar,time,flag
example:
filetime test.txt,A,C,DATE
flag Description A Last Access Time C Creation time W Last write time
syntax:
setftd filename,date,time,flag
example:
setftd test.txt,1/1/2002,8:00:00,W
syntax:
filesize filename,localvar
example:
filesize test.txt,A,
Attribute Value Normal 0 Read only 1 Hidden 2 System 4 Directory 16 Archive 32 Compressed 128 Temporary 256
Attribute Value Read only R Hidden H System S Directory D Archive A Compressed C Temporary T
syntax:
getattr filename,localvar,flag
example:
getattr test.txt,A,R
Attribute Value Normal 0 Read only 1 Hidden 2 System 4 Archive 8 Offline 16 Temporary 32
Attribute Value Normal N Read only R Hidden H System S Archive A Offline O Temporary T
syntax:
setattr filename,attr
example:
setattr test.txt,R
syntax:
filesrch filename,text,localvar,flag
example:
filesrch test.txt,hello there,A
filesrch test.txt,`he?? there`,B,I
filescrh test.txt,`h*e`,B,I
syntax:
nextsrch filename,text,localvar,flag
example:
nextsrch test.txt,hello there,A
nextsrch test.txt,`he?? there`,B,I
nextsrch test.txt,`h*e`,B,I
test.txt,hello there,B,I
syntax:
filescan filename,text,localvar,flag
example:
filescan test.txt,hello there,A
filescan test.txt,`he?? there`,B,I
filescan test.txt,`h*e`,B,I
syntax:
setdir directoryname
example:
setdir temp
setdir c:\temp
syntax:
getdir localvar
example:
getdir A
syntax:
makedir directoryname
example:
makedir temp
makedir c:\test\temp
syntax:
deldir directoryname
example:
deldir temp
deldir c:\temp
delfile c:\test\*.*
deldir c:\test
syntax:
getdisk localvar
example:
getdisk A
syntax:
finddisk localvar
example:
finddsik A
syntax:
nextdisk localvar
example:
nextdsik A
syntax:
disksize disk,localvar
example:
disksize c,A
msgbox Disk Size,Total disk size for drive C: is %A bytes,0
syntax:
diskfree disk,localvar
example:
diskfree c,A
msgbox Disk Size,Free disk size on drive C: is %A bytes,0
syntax:
diskused disk,localvar
example:
diskused c,A
msgbox Disk Size,Used disk size on drive C: is %A bytes,0
Value Desc Meaning -1 Undefined Operating system returned undefined info 0 Unknown Disk is unknown 1 No root Disk has no root directory 2 Removable Disk is removable 3 Fixed Disk is a fixed drive 4 Network Disk is a network or remote drive 5 CD-ROM Disk is a CD-ROM 6 RAM Disk is a RAM drive
syntax:
disktype drive,localvar,flag
example:
disktype C,A,v
syntax:
load drive
example:
load E
load d:
syntax:
eject drive
example:
eject E
eject d:
Mnemonic Key Root Branch HKCR HKEY_CLASSES_ROOT HKCC HKEY_CURRENT_CONFIG HKCU HKEY_CURRENT_USER HKLM HKEY_LOCAL_MACHINE HKU HKEY_USERS
Data Type Meaning Notes B Binary specified as hexadecimal pairs which may be optionally separated by spaces D Double word specified as a single hexadecimal number between 0 and FFFFFFFF S String specified as plain text E Expanded String specified when the data contains a system variable enclosed with percent (%) characters M Multivalued String specified by separating the individual strings with a vertical tab (|) character
syntax:
setreg keyvalue,type,data
example:
setreg HKCU\Control Panel\Colors\Button Text,S,test
setreg HKCU\Network\RestoreDiskChecked,D,1
setreg HKCU\RemoteAccess\DialUI,B,02 00 00 00
syntax:
getreg keyvalue,localvar
example:
getreg HKCU\Control Panel\Colors\Button Text,A
getreg HKCU\Network\RestoreDiskChecked,A
getreg HKCU\RemoteAccess\DialUI,A
syntax:
delreg keyvalue
example:
delreg HKCU/test1/test2/value
syntax:
findreg key,localvar
example:
findreg HKCU/test1/test2,A
syntax:
nextreg key,localvar
example:
nextreg HKCU/test1/test2,A
syntax:
makekey keybranch
example:
makekey HKCU/test1/test2/test3
syntax:
delkey keybranch
example:
delkey HKCU/test1/test2
syntax:
findkey key,localvar
example:
findkey HKCU/test1/test2,A
syntax:
nextkey key,localvar
example:
nextkey HKCU/test1/test2,A
syntax:
print filename
example:
print script.txt
syntax:
getprint localvar
example:
getprint A
msgbox Default Printer,Default printer is %A,0
syntax:
setprint printername
example:
setprint Generic / Text only printer
syntax:
findprnt localvar
example:
findprnt A
msgbox Installed Printer,First installed printer is %A,0
syntax:
nextprnt localvar
example:
findprnt A
setvar B,1
:loop
iferror end
msgbox Printer %B,%A,0,c
incvar B
:next
nextprnt A
goto loop
:end
Value Description wav the wave device mp3 the mpeg device seq the midi sequencer device cd the cd audio device
syntax:
open device,source,flag
example:
open wav,c:\windows\media\chime.wav
open mp3,c:\windows\media\test.mp3
open seq,c:\windows\media\canyon.mid
open cd,5
syntax:
seek device,position
example:
seek wav,1000
seek mp3,1000
seek seq,100
seek cd,4
syntax:
play device,position
example:
play wav
play mp3
play seq
play cd
play wav,c:\windows\media\chime.wav
play mp3,c:\windows\media\test.mp3
play seq,c:\windows\media\canyon.mid
play cd,5
syntax:
pause device
example:
pause wav
pause mp3
pause seq
pause cd
syntax:
resume device
example:
resume wav
resume mp3
resume seq
resume cd
syntax:
stop device
example:
stop wav
stop mp3
stop seq
stop cd
Flag Description Possible values c(urrent) current track number n(umber) number of tracks number s(tatus) status of device stopped, playing m(edia) media available true, false p(osition) current position in time units as for SEEK command p|n position in track n in time units as for SEEK l(ength) total length in time units as for SEEK l|n length of track n in time units as for SEEK t(ime) time format tsmf, milliseconds, song pointer
syntax:
getmedia device,localvar,flag
example:
getmedia wav,A,l
getmedia mp3,A,s
getmedia cd,A,n
getmedia cd,B,l|4
syntax:
makelink linkname,filename,flag
example:
makelink c:\test.lnk,c:\bootlog.txt
Info Description a(rg) command line arguments for the shortcut target d(esc) shortcut description h(ot) hotkey to activate the shortcut i(con) location and index of the shortcut icon p(ath) path to the shortcut target s(how) show command when displayed w(ork) working directory for the target to the shortcut
syntax:
getlink linkname,localvar,info
example:
getlink c:\test.lnk,A,path
Info Description a(rg) command line arguments for the shortcut target d(esc) shortcut description h(ot) hotkey to activate the shortcut i(con) location and index of the shortcut icon p(ath) path to the shortcut target s(how) show command when displayed w(ork) working directory for the target to the shortcut
Key Key code 0 - 9 48 - 57 A - Z 65 - 90 Shift 256 Ctrl 512 Alt 1024
syntax:
setlink linkname,info,value
example:
setlink c:\test.lnk,d,Test shortcut
Icon Description A Application window icon E Exclamation mark icon I Information icon F Icon file L Windows logo icon Q Question mark icon S Script icon X Red X icon
Click Description LC Left mouse click LD Left mouse double click RC Right mouse click RD Right mouse double click
syntax:
puttray text,label1|label2,icon,click1|click2
examples:
puttray Scheduled Backup,exit
puttray Scheduled Backup,exit,X
puttray Scheduled Backup,exit,X,RD
puttray Scheduled Backup,settim|exit,X,LD|RC
syntax:
modtray text,label,icon,click
example:
modtray Scheduled Backup,,,RC
syntax:
deltray
example:
deltray
Flag Description B(ITMAP) Windows bitmap file H(TML) HTML Formatted file M(SHTML) Microsoft HTML Formatted R(TF) Rich Text Formatted text TE(XT) Plain text TI(FF) Picture file in TIFF format W(AVE) Wave audio file in standard format
syntax:
getclip localvar,flag
example:
getclip A,RTF
getclip B
Flag Description B(ITMAP) Windows bitmap file H(TML) HTML Formatted file M(SHTML) Microsoft HTML Formatted R(TF) Rich Text Formatted text TE(XT) Plain text TI(FF) Picture file in TIFF format W(AVE) Wave audio file in standard format
syntax:
setclip data,flag
example:
setclip This is a test
setclip %B,RTF
syntax:
clrclip
example:
clrclip
syntax:
geturl url,localvar
example:
geturl http://www.melbpc.org.au/index.html,A
syntax:
ping host,timeout,size,TTL
example:
ping 192.168.0.1,5
ping www.test.com.au,10,64,250
syntax:
goto label
example:
goto exit
.
.
.
:exit
syntax:
gosub label
example:
gosub test
goto exit
:test
Msgbox Message,In subroutine,0
return
:exit
syntax:
return
example:
return
Command Description Value MSGBOX OK
Cancel
Abort
Retry
Ignore
Yes
No
Try Again
Continue1
2
3
4
5
6
7
10
11MENUBOX Cancel
Selected item in menu0
1..7LISTBOX Cancel
Selected item in list0
1..nEDITBOX OK
Cancel1
2FILEBOX OK
Cancel1
2
syntax:
casemsg label1|label2|label3|...|labeln
example:
editbox Test
casemsg exit|ok|cancel
.
.
.
:exit
Text Number OK 1 Cancel 2 Abort 3 Retry 4 Ignore 5 Yes 6 No 7 Try Again 10 Continue 11
syntax:
ifmsg result,label
ifnmsg result,label
example:
msgbox Test,Click a button,2
ifmsg cancel,exit
.
.
.
:exit
syntax:
iferror label
ifnerror label
example:
iferror exit
.
.
.
:exit
syntax:
ifbit localvar,bit,label
ifnbit localvar,bit,label
example:
ifbit A,3,exit
.
.
.
:exit
syntax:
ifexist filename,label
ifnexist filename,label
example:
ifexist c:\winnt\notepad.exe,loop
syntax:
ifvar localvar,value,label
ifnvar localvar,value,label
example:
ifvar A,test,exit
.
.
.
:exit
syntax:
ifevar localvar,value,label
ifgvar localvar,value,label
iflvar localvar,value,label
example:
ifgvar A,%B,exit
.
.
.
:exit
syntax:
casevar localvar,value1|value2|...|valuen,label1|label2|...|labeln
example:
editbox Test,Enter the name of a fruit,A
casevar A,apple|banana|orange|mango,goapple|gobanana|goorange|gomango
goto nomatch
syntax:
getname localvar
example:
getname A
msgbox Computer name,Computer name is %A,0
syntax:
getuser localvar
example:
getuser A
msgbox User name,Current user is %A,0
Flag Description c complete (default if flag is omitted) h hours m minutes s seconds f AM or PM
If 12 hour format is specified and flag is c (or omitted), AM or PM will be appended to the complete time.
Format Description y 24 hour (default if format parameter omitted) n 12 hour
syntax:
gettime localvar,flag,format
example:
gettime A
msgbox Time,System time is %A,0
Flag Description c complete (default if flag is omitted) w day of week d day of month m month of year y years
Flag Format Description c s year number in short 2 digit format l year number in long 4 digit format (default) w n Displayed as a number 0=Sun, 1=Mon etc. (default) s name of day in short format (first 3 letters) l name of day in long format (full name) m n number 1=Jan, 2=Feb, etc. (default) s name of month in short format (first 3 letters) l name of month in long format (full name) y s number in short 2 digit format l number in long 4 digit format (default)
syntax:
getdate localvar,flag,format
example:
getdate A
msgbox Date,System date is %A,0
syntax:
settime hours,mins,secs
example:
settime 10,23,45
settime 22,30
syntax:
setdate days,mons,years
example:
setdate 10,2,2003
syntax:
rawdate dd/mm/yyyy,hh:mm:ss,localvar
example:
rawdate 10/2/2003,10:30:00,A
rawdate 10/2/2003,,A
Flag Description Possible values f family 9X,NT p platform 95,98,ME,NT,2000 m major version no. 3,4,5... n minor version no. 51,0,10... x extra info service pack for NT/2000
revision level for 95/98/ME
syntax:
winver localvar,flag
example:
windir A,p
msgbox Windows Version,Running Windows %A,0
syntax:
windir localvar
example:
windir A
msgbox Windows Directory,Windows directory is %A,0
syntax:
sysdir localvar
example:
sysdir A
msgbox System Directory,System directory is %A,0
Folder Description ALLD(ESKTOP) File system directory that contains files and folders that appear on the desktop for all users. ALLF(AVORITES) File system directory that serves as a common repository for all users' favorite items. ALLP(ROGRAMS) File system directory that contains the directories for the common program groups that appear on the Start menu for all users. ALLSTARTM(ENU) File system directory that contains the programs and folders that appear on the Start menu for all users. ALLSTARTU(P) File system directory that contains the programs that appear in the Startup folder for all users. AP(PDATA) File system directory that serves as a common repository for application-specific data. C(OOKIES) File system directory that serves as a common repository for Internet cookies. D(ESKTOP) File system directory used to physically store file objects on the desktop F(AVORITES) File system directory that serves as a common repository for the user's favorite items. H(ISTORY) File system directory that serves as a common repository for Internet history items. I(NTERNETCACHE) File system directory that serves as a common repository for temporary Internet files. N(ETHOOD) File system directory containing objects that appear in the network neighborhood. PE(RSONAL) File system directory that serves as a common repository for documents (My Documents). PRI(NTHOOD) File system directory that serves as a common repository for printer links. PRO(GRAMS) File system directory that contains the user's program groups (which are also file system directories). RECE(NT) File system directory that contains the user's most recently used documents. RECY(CLEBIN) File system directory containing file objects in the user's Recycle Bin. SE(NDTO) File system directory that contains Send To menu items. STARTM(ENU) File system directory containing Start menu items. STARTU(P) File system directory that corresponds to the user's Startup program group. The system starts these programs whenever any user logs onto Windows NT or starts Windows 95. T(EMPLATES) File system directory that serves as a common repository for document templates.
syntax:
specdir folder,localvar
example:
specdir desktop,A
msgbox Desktop Directory,Directory is %A,0
syntax:
memsize localvar
example:
memsize A
msgbox Memory Size,System memory size is %A Mbytes,0
syntax:
getscrnx localvar
example:
getscrnx A
msgbox Screen width,Screen width is %A,0
syntax:
getscrny localvar
example:
getscrny A
msgbox Screen height,Screen height is %A,0
syntax:
setscrn width,height,depth
example:
setscrn 1024,768,24
setscrn %A,%B,%C
syntax:
logoff flag
example:
logoff
logoff F
syntax:
shutdown flag
example:
shutdown
shutdown F
syntax:
poweroff flag
example:
poweroff
poweroff F
syntax:
restart flag
example:
restart
restart F
syntax:
scrnsave
example:
scrnsave
syntax:
lockpc
example:
lockpc
syntax:
activate windowtitle
example:
activate Untitled - Notepad
syntax:
minimise windowtitle
example:
minimise Untitled - Notepad
syntax:
maximise windowtitle
example:
maximise Untitled - Notepad
syntax:
restore windowtitle
example:
restore Untitled - Notepad
syntax:
flash windowtitle
example:
flash Untitled - Notepad
syntax:
close windowtitle
example:
close Untitled - Notepad
syntax:
destroy windowtitle
example:
destroy Untitled - Notepad
syntax:
setdesk filename
example:
setdesk picture.bmp
syntax:
setbgnd red,green,blue
example:
setbgnd 50,100,150
syntax:
delay number
example:
delay 50
syntax:
suspend hh:mm:ss,DD/MM/YYYY
example:
suspend 2 (suspend until 2am)
suspend H (suspend until start of next hour)
suspend 13:20 (suspend until 1:20pm)
suspend 2,15 (suspend until 2am on the 15th of the month)
suspend 3,sat (suspend until 3am Saturday)
syntax:
idle
example:
idle
syntax:
quit
example:
quit
Parameter Description 0 Beep through internal speaker 1 Sound for OK icon 2 Sound for Hand icon 3 Sound for Question icon 4 Sound for Exclamation icon 5 Sound for Asterisk icon
syntax:
beep value
example:
beep 1
syntax:
random value,localvar
example:
random 10,A
Parameter Description exit the first error is reported and further script processing stops on errors are reported and script processing continues off no errors are reported
syntax:
report [off|on|exit]
example:
report exit
report on
report off
syntax:
step [off|on]
example:
step on
step off
syntax:
debug [off|on]
example:
debug on
debug off
syntax:
dbgbox message
example:
dbgbox Value of A is %A
syntax:
version localvar
example:
version A
msgbox Script Version,Script is running version %A,0
syntax:
compile script,executable,flag
example:
compile test.script,test.exe
syntax:
priority level
example:
priority low
priority normal
syntax:
varsize size
example:
varsize 4096
syntax:
inseq flag
example:
inseq on