List of Fixes and Improvements
WinBatch versions 98A through 2000C
Keywords: fixes improvements new releases features
WB 98A Jun 15, 1998
WinBatch compiler now accepts a single file name as a command-line
parameter (such as via drag-and-drop).
WinBatch compiler no longer converts output file name to lower case.
WinBatch compiler now removes end-of-line comments as well as entire
comment lines when optimizing WBT's.
Added the ability to embed external files when running or compiling a
WinBatch script, by using the new "#include" pre-processor directive.
The syntax is:
#include "filename"
The keyword "#include" must begin in column 1, and must be all lower-case.
The file name must be delimited by double quotes. The file name may contain
path information, and does not need to have an extension of WBT. Nothing
else should appear on the line.
Each line containing a #include directive will be replaced by the contents
of the specified file. If the file cannot be found, an error will occur.
When using the WinBatch compiler, the "included" file(s) must be present
at compile time; they will be embedded in the compiled EXE, and therefore
do not need to be distributed as separate files.
When using the interpreted version of WinBatch, the "included" file(s)
must be present at the point in time when the script is launched (they
cannot be created "on-the-fly" from within the script).
You can have as many #include directives as you wish, and they may be
nested (ie, "included" files may themselves conatin #include directives).
However, the WinBatch script and all files being included, when merged
together, cannot exceed 64K in size (after comments and whitespace are
optimized by the WinBatch compiler).
DLL 2.5abq First showing up in WB 98A
New functions:
BinaryCompare(handle1, offset1, handle2, offset2, count)
Compares portions of two binary buffers.
(i) handle1: handle of first buffer.
(i) offset1: zero-based offset into the first buffer specifying where the data to
be compared starts.
(i) handle2: handle of second buffer.
(i) offset2: zero-based offset into the second buffer specifying where the data to
be compared starts.
(i) count: the number of bytes to compare.
The specified sections of the buffers are compared on a byte-by-byte
basis. This function is case-sensitive.
"handle1" and "handle2" may both reference the same buffer, in which
case two sections of the buffer can be compared.
Returns @TRUE if the sections are identical; @FALSE otherwise.
BinaryReadEx(handle, binary-offset, filename, file-offset, count)
Reads a portion of a file into a binary buffer.
(i) handle: handle of buffer.
(i) binary-offset: zero-based offset into the buffer specifying
where the data should be stored.
(i) filename: file to read into buffer.
(i) file-offset: zero-based offset into the file specifying where
the data to be read starts.
(i) count: the number of bytes to read.
This function reads "count" bytes from "filename", beginning at
"file-offset". It then writes the data to the buffer specified by
"handle", beginning at "binary-offset". Any existing data in the
buffer within the range "binary-offset + count" is overwritten with
the new data; any existing data outside that range is left untouched.
Returns the number of bytes read.
BinaryWriteEx(handle, binary-offset, filename, file-offset, count)
Writes a portion of a binary buffer to a file.
(i) handle: handle of buffer.
(i) binary-offset: zero-based offset into the buffer specifying
where the data to be read starts.
(i) filename: file to write to.
(i) file-offset: zero-based offset into the file specifying where
the data should be stored.
(i) count: the number of bytes to write.
This function reads "count" bytes from the buffer specified by
"handle", beginning at "binary-offset". It then writes the data to
"filename", beginning at "file-offset". Any existing data in the file
within the range "file-offset + count" is overwritten with the new
data; any existing data outside that range is left untouched.
If "filename" does not exist, it will be created. If the existing
file is smaller than "file-offset", NULL bytes will be added to the
end of the file to increase its size to "file-offset", and then the
specified data will be written beginning at "file-offset".
Returns the number of bytes written.
BinaryAnd(target-handle, target-offset, source-handle, source-offset, count)
Performs a bitwise AND on portions of two binary buffers.
(i) target-handle: handle of target buffer.
(i) target-offset: zero-based offset into the target buffer specifying
where the data to be processed starts, and where the result of
the operation should be placed.
(i) source-handle: handle of source buffer.
(i) source-offset: zero-based offset into the source buffer specifying
where the data to be processed starts.
(i) count: the number of bytes to process.
The specified sections of the buffers are processed on a byte-by-byte
basis, and the results are written to the buffer specified by
"target-handle". Ie, the byte at "source-offset" is AND'ed with the
byte at "target-offset", and the result of the AND operation is stored
in the byte at "target-offset", then the bytes at "source-offset + 1"
and "target-offset + 1" are AND'ed, and so on.
"target-handle" and "source-handle" may both reference the same buffer,
in which case two sections of the buffer can be processed.
Returns 1.
BinaryOr(target-handle, target-offset, source-handle, source-offset, count)
Performs a bitwise OR on portions of two binary buffers.
The specified sections of the buffers are processed on a byte-by-byte
basis, and the results are written to the buffer specified by
"target-handle". Ie, the byte at "source-offset" is OR'ed with the
byte at "target-offset", and the result of the OR operation is stored
in the byte at "target-offset", then the bytes at "source-offset + 1"
and "target-offset + 1" are OR'ed, and so on.
"target-handle" and "source-handle" may both reference the same buffer,
in which case two sections of the buffer can be processed.
See BinaryAnd for parameter information.
Returns 1.
BinaryXor(target-handle, target-offset, source-handle, source-offset, count)
Performs a bitwise XOR (exclusive OR) on portions of two binary buffers.
The specified sections of the buffers are processed on a byte-by-byte
basis, and the results are written to the buffer specified by
"target-handle". Ie, the byte at "source-offset" is XOR'ed with the
byte at "target-offset", and the result of the XOR operation is stored
in the byte at "target-offset", then the bytes at "source-offset + 1"
and "target-offset + 1" are XOR'ed, and so on.
"target-handle" and "source-handle" may both reference the same buffer,
in which case two sections of the buffer can be processed.
See BinaryAnd for parameter information.
Returns 1.
BinaryConvert(handle, source-type, target-type, code-page, flags)
Converts a binary buffer.
(i) handle: handle of buffer.
(i) source-type: format of existing data in buffer.
(i) target-type: format of data which the buffer will be converted to.
(i) code-page: code page for 8-bit <-> Unicode conversions.
(i) flags: additional options.
This function can be used to perform the following types of conversions:
8-bit <-> Unicode
Multibyte <-> Unicode
ANSI <-> OEM
-> Uppercase
-> Lowercase
"Source-type" and "target-type" can be one of the following:
0 8-bit ANSI
1 8-bit OEM
2 Multibyte (eg, double-byte)
3 Unicode
Conversions from 8-bit (types 0 or 1) to or from multibyte (type 2)
are not supported. If you need to perform this type of conversion,
you can do it in two steps, using Unicode as an intermediate stage
(eg, ANSI to Unicode, then Unicode to multibyte).
For conversions to or from Unicode, a code page must be specified
for the 8-bit (non-Unicode) character set. "Code-page" can be any
valid code page on your system, or one of the following default code
pages:
0 ANSI
1 OEM
2 Macintosh
For conversions which don't involve Unicode, "code-page" is ignored.
"Flags" can be one of the following:
1 Convert to uppercase
2 Convert to lowercase
Note that Unicode uses two bytes for each character. Therefore, for
conversions to Unicode, the binary buffer must be large enough to hold
at least twice as much data as is currently in the buffer. Ie, if
you are trying to convert a buffer which contains a 40-character
string to Unicode, the buffer must be at least 80 bytes in size,
because the resulting Unicode string will be 80-bytes long.
Returns the new binary EOD (end of data) for the buffer.
BinaryClipGet(handle, format)
Reads the contents of the Windows clipboard into a binary buffer.
(i) handle: handle of buffer.
(i) format: format of clipboard data.
The following is a list of possible clipboard formats. Note that some
of them may not be supported, because the clipboard contains a pointer
or handle to external data instead of the data itself.
1 CF_TEXT
2 CF_BITMAP (not supported)
3 CF_METAFILEPICT
4 CF_SYLK
5 CF_DIF
6 CF_TIFF
7 CF_OEMTEXT
8 CF_DIB
9 CF_PALETTE
10 CF_PENDATA
11 CF_RIFF
12 CF_WAVE
13 CF_UNICODETEXT
14 CF_ENHMETAFILE
15 CF_HDROP
16 CF_LOCALE
128 CF_OWNERDISPLAY
129 CF_DSPTEXT
130 CF_DSPBITMAP
131 CF_DSPMETAFILEPICT
142 CF_DSPENHMETAFILE
Returns the number of bytes read from the clipboard.
BinaryClipPut(handle, format)
Writes a binary buffer to the Windows clipboard.
(i) handle: handle of buffer.
(i) format: format of clipboard data.
Note that this function destroys the previous contents of the clipboard.
See BinaryClipGet for parameter information.
Returns 1.
FileTimeGetEx(filename, time-field) (32-bit only)
Gets extended time information for a file or directory.
This function is like FileYmdHms, but works with directories as well
as files, and lets you specify which time field you want to get.
"Filename" can specify a file or directory name. "Time-field" can
be one of the following:
1 file created
2 file last modified
3 file last accessed
Returns file time in YmdHms format.
FileTimeSetEx(file-list, YmdHms, time-field) (32-bit only)
Sets extended time information for one or more files.
This function is like FileTimeSet, but lets you specify which time
field you want to set. "Time-field" can be one of the following:
1 file created
2 file last modified
3 file last accessed
Returns @TRUE on success; @FALSE if any of the specified files could
not be changed.
ObjectAccess(app.objname, create-flag)
Opens or creates an OLE 2.0 Automation object.
If there is already a running instance of the object specified by
"app.objname", this function will return a handle to that object.
If there is not a running instance of the specified object, the
behavior will depend on the value of 'create-flag':
If 'create-flag' == @TRUE, it will create an instance of the
object, and return a handle to it.
If 'create-flag' == @FALSE, it will fail and return an error.
This function is similar to ObjectOpen, except that ObjectOpen always
creates a new object and cannot be used to access an existing one.
See Object101 section for information on OLE Automation.
DirSize(s:dir-name, i:flags)
Finds the total size of a directory.
This function returns the total size of a directory, including all
files in the directory, and all files in all subdirectories under
the directory.
Flags Meaning
----- -------
1 Instead of returning the actual size of the files, return
the amount of disk space they occupy. This is based upon
the disk's cluster size. This flag is valid only if the
specified directory is on a local drive or a network drive
mapped to a drive letter; it does not support UNC's.
Returns the size in bytes. The return value will be a floating
point number if it is larger than 2 gigabytes.
SendMenusToEx(s:window-name, s:menu-name, s:class-name, s:type, s:flags)
Selects a menu item from an application.
This function is similar to SendMenusTo, but supports non-standard
menu types. The "type" parameter identifies the type of menu:
Type Description
---- -----------
0 Standard pull-down menu
1 Microsoft Office 97 application menu (32-bit only)
The other parameters depend on "type":
Type 0:
This works exactly the same as the SendMenusTo function. The
"class name" and "flags" parameters are ignored.
Type 1:
This works with the main application control bar in Microsoft
Office 97 applications, such as Microsoft Word and Microsoft Excel.
"window-name" specifies the application window that will be
activated before the menu item is selected. If a blank string
("") is specified, no window activation will be performed (in
which case the window would need to already be active).
"menu-name" specifies the menu item(s) to be selected. Each
component must be separated by a vertical bar ("|"). So, to
select "Open..." from the "File" menu, you would use:
"File|Open..."
"class-name" is the OLE class string in the Windows registry
which identifies the application, such as:
Word.Application
Excel.Application
Access.Application
If more than one instance of the application identified by
"class-name" is currently running, the command will be sent to
the first one that is found. The "window-name" paramater cannot
be used to identify a particular instance of the applicaton.
"flags" is currently ignored, and should be set to 0.
Returns @TRUE on success, @FALSE on failure.
Examples:
SendMenusToEx("~Notepad", "File | Open...", "", 0, 0)
SendMenusToEx("Microsoft Word -", "File|Open...", "Word.Application", 1, 0)
AskDirectory(prompt, browse-root, start-dir, confirm-prompt, flags) (32-bit, Win95/NT40 only)
Displays a directory browse dialog box, and returns the selected directory name.
(s) prompt: prompt to be displayed in the dialog box above the list
of directories. This can be a blank string ("") if no prompt is
desired. Note that the title of the dialog box ("Browse for
Folder") cannot be changed.
(s) browse-root: directory under which the user can browse for
directories. The user will not be able to browse above this
level. You can specify a blank string ("") to allow the entire
file system (all drives, directories, and network shares) to be
browsed.
(s) start-dir: the directory which will be selected by default when
the dialog box is initially displayed. This can be a blank
string (""), in which case the top of the tree will be selected
(same as 'browse-root').
(s) confirm-prompt: the title of the confirmation message box (see
'flags' #2, below).
(i) flags: one or more of the following optional flags, combined
using the binary OR ("|") operator, or 0 if none are desired:
Flag Meaning
---- -------
1 Display an edit field in the dialog box, in which the
user can type the name of a directory which may or may
not exist. This name will be relative to the currently
selected directory name in the browse list.
NOTE: This is supported only in Windows 98, Windows
NT 5.0, or in earlier versions of Windows that have
Internet Explorer 4.0 installed. In other versions
of Windows, this flag is ignored.
2 If the user types a name in the edit field (see flag #1),
of a directory which does not exist, this flag causes a
confirmation message box to be displayed, showing the
name of the directory that would be returned by the
function, and containing three buttons: Yes, No, and
Cancel. If the user selects 'Yes', the function returns.
If the user selects 'No', the directory browse dialog
remains displayed, and the user can re-edit the name or
select a different directory. 'Cancel' causes the
function to return, and standard WIL "cancel" processing
to be performed.
The title of the message box is specified by
'confirm-prompt'.
Returns the directory name selected in the browse dialog. If the user
presses "Cancel", standard WIL "cancel" processing will be performed.
New IntControls:
IntControl(53, p1, 0, 0, 0)
Set line terminator type for FileWrite.
P1 Terminator
-- ----------
-1 Don't change (just return current setting)
0 No line terminator
1 CR/LF (DOS) (default)
2 LF (UNIX)
3 CR (Macintosh)
4 tab
Normally, FileWrite adds a carriage return and line feed (CR/LF) after
writing each line to the file. This IntControl lets you select a
different line terminator, or none at all, as specified by "p1".
Returns previous setting.
IntControl(54, p1, p2, 0, 0)
Keep window on top.
This IntControl tells the specified window to remain on top of all
other windows, or to return to a normal (non-topmost) state.
P1 = partial windowname of the window to be affected.
P2 Meaning
-- -------
0 Don't stay on top
1 Stay on top
Returns @TRUE on success, @FALSE on failure.
IntControl(56, p1, 0, 0, 0)
Terminate an application.
This IntControl lets you terminate an application abruptly.
Normally, you should use WinClose to close an application
gracefully, but sometimes that may not be possible. Using this
IntControl is a drastic, last-resort method of terminating an app.
Note: You will not receive any warning from the operating system
before the application is closed, even if it contains unsaved
work. Also, this function may leave the system in an unstable
state. Use this function carefully.
P1 = partial windowname of the application you wish to terminate.
Returns @TRUE on success, @FALSE on failure.
IntControl(57, p1, 0, 0, 0) (32-bit, Windows 95 only)
Disable/enable system keys.
This IntControl can be used to disable (or re-enable) the following
system key-combinations:
It works by telling the operating system that the screen saver is
running (even though it isn't), which disables those keys.
P2 Meaning
-- -------
0 Enable system keys
1 Disable system keys
Note: This function is not supported in Windows NT.
Returns @TRUE on success, @FALSE on failure.
IntControl(58, p1, 0, 0, 0) (32-bit only)
Set system time.
P1 = new system time, in YmdHms format.
This IntControl changes the time of the computer's system clock.
Returns @TRUE on success, @FALSE on failure.
IntControl(59, p1, p2, 0, 0)
Sends a WM_WININICHANGE or WM_SETTINGCHANGE message.
This IntControl sends a message to one or all application windows,
informing them that a change has been made to WIN.INI or to the
registry.
p1 = window handle of the window to send the message to, or -1 for
all top-level windows.
p2 = name of the WIN.INI section or registry key that has been
changed. If this parameter specifies a WIN.INI section, it
should not include square brackets around the name. If it
specifies a registry key, it typically indicates only the
leaf node in the registry, not the whole path, but this will
be application-dependent. You can specify a blank string
("") to request that the application re-read all sections or
keys that affect it.
In the 16-bit version, this sends a WM_WININICHANGE message. In the
32-bit version, it sends a WM_SETTINGCHANGE message.
Returns @TRUE on success; @FALSE on error.
IntControl(60, p1, p2, 0, 0)
Sends a WM_DEVMODECHANGE message.
This IntControl sends a message to one or all application windows,
informing them that a change has been made to device mode settings.
p1 = window handle of the window to send the message to, or -1 for
all top-level windows.
p2 = name of the device (as specified in the [Devices] section of
WIN.INI) whose settings have been changed.
Returns @TRUE on success; @FALSE on error.
IntControl(61, p1, 0, 0, 0) (32-bit only)
Sets WinActivate() method.
In Windows 98 and NT 5.0, the standard method that WinActivate (and
SendKeysTo and MouseClick) uses to activate an application window is
no longer supported. Therefore, we must use an alternate method to
activate windows under these operating systems. This IntControl lets
you change the current method being used. Some methods may work with
some particular windows and not others, so you may need to experiment.
P1 Method to use
-- -------------
-1 Don't change (just return current setting).
0 Standard method (SetForegroundWindow API call).
1 Switch to the window, then click on it.
2 Iconize the window, then switch to it.
The default method is "1" when running under Windows 98 or NT 5.0.
The default is "0" when running under previous versions of Windows.
Returns previous setting.
IntControl(62, p1, 0, 0, 0) (32-bit only)
Sets dialog activation method.
This IntControl lets you change the method used to activate dialog
windows that are displayed by the WIL Interpreter. See IntControl(61)
for more information.
The date string returned by the TimeDate function now includes a 4-digit
year, if this was configured via Control Panel.
In 32-bit version under Windows NT, RegDeleteKey now deletes a key even if
it has subkeys (under Windows 95 it has always done this).
In 32-bit version, added additional options for the "level" parameter in
WinVersion:
Level Returns
----- -------
2 (i) Build number
3 (s) CSD version
Under Windows NT, CSD version is a string indicating the latest
service pack that has been installed (eg, "Service Pack 1"), or a
blank string ("") if no service pack has been installed. Under
Windows 95, it is a string that may indicate arbitrary additional
information about the operating system, or may be blank.
Added additional special characters to the SendKey (and SendKeysTo and
SendKeysChild) functions:
Key SendKey equivalent
--- ------------------
0 on numeric keypad {NUMPAD0}
1 on numeric keypad {NUMPAD1}
2 on numeric keypad {NUMPAD2}
3 on numeric keypad {NUMPAD3}
4 on numeric keypad {NUMPAD4}
5 on numeric keypad {NUMPAD5}
6 on numeric keypad {NUMPAD6}
7 on numeric keypad {NUMPAD7}
8 on numeric keypad {NUMPAD8}
9 on numeric keypad {NUMPAD9}
* on numeric keypad {NUMPAD*}
+ on numeric keypad {NUMPAD+}
- on numeric keypad {NUMPAD-}
. on numeric keypad {NUMPAD.}
/ on numeric keypad {NUMPAD/}
Enter on numeric keypad {NUMPAD~} (32-bit only)
In 32-bit version, the Run[..] commands can now be used to launch a
shortcut to a non-executable, such as a document or a directory. However,
the "Wait" option is ignored in this case.
Fixed problem with TimeSubtract failing if the result was less than 1 year.
If the "length" parameter of StrSub is past the end of the string, it now
extracts to the end of the string, instead of returning a blank string.
Changed FileRead to treat line feeds as line terminators, instead of
carriage returns. This means that FileRead now supports both DOS files
(which have CR/LF terminators) and UNIX files (which have LF terminators).
Fixed problem with IntControl(5) in the 32-bit version.
In the Dialog function, ampersands ("&") are no longer being converted to
underscores in static text and varying text fields.
Added parameter to IntControl(49):
IntControl(49, p1, p2, 0, 0)
p2 = specifies the value that a dialog box (created using the "Dialog"
function) will return if the user closes the dialog without pressing
one of the pushbuttons in the dialog (eg, by pressing , or
by clicking on the "Close" icon in the title bar). The default is 1.
If a dialog returns 0, processing will be transferred to the label in
the script marked ":Cancel" (if any).
IntControl(40) now correctly sets the share mode used when opening a file
in "APPEND" mode with FileWrite(previously, it was only affecting files
opened in "WRITE" mode).
Fixed problem with input focus being lost when a dialog (created using the
"Dialog" function) was minimized and restored.
In 32-bit version, fixed problem prepending the path specified in the registry
under "App Paths" when launching a program, if the existing path was more than
300 characters long.
In 32-bit version, FileTimeGet no longer updates the file's last-access time.
SendKey (and SendKeysTo and SendKeysChild) now turns caps lock off while
sending keystrokes (and restores the previous state when it is done). This
fixes a problem that was occurring when caps lock was on, and a shifted key
combination was specified [eg, SendKey("+a")], resulting in a lower-case
character being sent. Although this was faithfully duplicating the behavior
of typing keystrokes manually ("reverse caps lock"), the intended behavior
is for SendKey to ignore the caps lock state, and to therefore behave
consistently whether caps lock is on or off.
In 32-bit version under Windows 95, fixed problem using KeyToggleSet twice
in a row.
Fixed bug in StrIndexWild that could cause program to hang.
Improved parameter handling for OLE functions:
OLE functions now support up to 20 parameters (instead of 5).
OLE functions now support omitted optional positional parameters, using
commas as placeholders. For example:
Application.Display("Hello", 100, 100, , 1)
OLE functions now support named parameters. The syntax structure is:
Object.Method(p1, p2 :: n3 = v3, n4 = v4)
Positional parameters (shown as p1 and p2), if any, come first,
followed by a double colon ("::"), and then any named parameters (n3
and n4). Each named parameter is followed by an equals sign ("=") and
then the value for the parameter (v3 and v4). Whitespace is ignored.
Here are some examples:
; 2 positional parameters
Application.InputBox("My Prompt", "My Title")
; 2 positional parameters and 2 named parameters
Application.InputBox("My Prompt", "My Title" :: Left = 40, Top = 300)
; no positional parameters and 2 named parameters (note the leading colon)
Application.InputBox(:: Prompt = "My Prompt", Title = "My Title")
OLE functions now allow you to specify a type for integer parameters.
Normally, when you specify an integer value as a parameter to an OLE
function, WIL passes it as a type VT_I4 (4-byte integer value). If the
OLE application was expecting the parameter to be a different type of
numeric value, in most cases it will automatically convert it to the
desired type. However, there are some OLE applications which don't do
this, and return an error instead. In such cases, you can specify the
type, using the following syntax:
Object.Method(p1, t2:p2 :: n3 = v3, t4:n4 = v4)
The parameter type (shown as t2 and t4) is followed by a single colon
(":"), and then the parameter itself (p2 and n4). This can be done
for both positional parameters (p2) and named parameters (n4).
Whitespace is ignored, and the type names are not case-sensitive.
Here are the types which may be specified for integer parameters:
Type Name Meaning
---- ---- -------
UI1 VT_UI1 An unsigned 1-byte character. (32-bit version only)
I2 VT_I2 A 2-byte integer value.
I4 VT_I4 A 4-byte integer value.
BOOL VT_BOOL A Boolean (True/False) value.
The type name that gets specified in the WIL command is the same
as the equivalent OLE name, but without the leading "VT_".
The default type for integer values is "I4" (VT_I4).
In addition, you can now specify a date type for string parameters,
for OLE functions which require a parameter of type VT_DATE:
Type Name Meaning
---- ---- -------
DATE VT_DATE A date/time string, in Ymd or YmdHms format.
Here are some examples:
; this function requires a parameter of type VT_I2
Application.CreateImageViewerObject(I2:1)
; this function requires a (named) parameter of type VT_DATE
Application.CreateLog("access.log" :: DATE:startdate="97:11:01")
Return values from OLE functions which have a return type of VT_DATE
are now automatically converted to a YmdHms string in the form
"YYYY:MM:DD:HH:MM:SS" (this will always contain a 4-digit year,
regardless of the setting specified by IntControl 41).
Fixed string memory leak with OLE functions.
The following functions, which return a date string in YmdHms format, now
return a 4-digit year by default. This can be changed using IntControl(41):
FileYmdHms
TimeAdd
TimeJulToYmd
TimeSubtract
TimeYmdHms
Under Windows 98 and NT 5.0, fixed problem with WinActivate and SendKeysTo
not working, and problem with WIL dialogs not being activated. By default,
an alternate window activation method will be used under these operating
systems, which can be modified with IntControl(61) and IntControl(62).
Under Windows 98 and NT 5.0, messages boxes are now brought to the
foreground, but they will not be activated.
DiskScan no longer adds a trailing delimiter to the returned list.
DiskFree and DiskSize now accept lists with a trailing delimiter.
In the "overwrite warning" dialog in FileCopy and FileMove, if the file
name is too long to be displayed in its entirety, the beginning and end of
the name are now displayed, instead of the name simply being truncated.
In 32-bit version, the Wallpaper() function now supports the Active Desktop
wallpaper in Internet Explorer 4.0.
Fixed problem with StrIndexWild returning 0 if an asterisk ("*") in the
wildcard pattern matched 0 characters in the string.
In 32-bit version, improved the way FileFullName handles relative path
names, when the current directory is a UNC (network share).
The following functions no longer return a delimiter at the end of the list:
DirItemize
FileItemize
IntControl(31)
ItemInsert
ItemRemove
ItemSort
NetInfo
WinItemize
WinItemChild
WinItemNameId
Functions which take a date/time string in YmdHms format now return an
error if "24" is specified as the hour.
Windows 95 extender 11003 First showing up in WB 98A
The following functions have been renamed and moved to the new Windows
95/RADMIN (remote administration for Windows NT) extender. The existing
functions will continue to work in this version, but may be removed or
modified in future versions. Note that some of the parameters in the new
DLL have been changed (specifically, a "group-type" parameter has been
added to the w95ListGroups and w95Member[..] functions). Refer to the
help file for the new extender for further information.
Old name New name
------------- -------------
w95ListGroups w9xListGroups
w95MemberDel w9xMemberDel
w95MemberGet w9xMemberGet
w95MemberGrps w9xMemberGrps
w95MemberList w9xMemberList
w95MemberSet w9xMemberSet
w95ServiceAt w9xServiceAt
w95UserInfo w9xUserInfo
New functions:
w95ServerType(s:server-name)
Returns a server's platform.
"server-name" is the UNC name of a server (eg, "\\SERVER1"), or a
blank string ("") to indicate the local machine.
Returns one of the following values:
Value Meaning
----- -------
0 Invalid server name
1 Other
2 Windows for Workgroups
3 Windows 95 or later
4 Windows NT
w95ServiceInf(s:server-name)
Returns a server's type.
"server-name" is the UNC name of a server (eg, "\\SERVER1"), or a
blank string ("") to indicate the local machine.
Returns a bitmask indicating the type of server, or 0 on error. The
individual flag bits in the bitmask can be extracted using the binary
AND ("&") operator.
See the "server-type" parameter in w95ServiceAt for a list of flag bits.
w95ShareAdd now creates persistent shares (ie, they do not disappear when
you reboot).
In 32-bit version, IntControl(68) (shut down computer) now does a power-off,
if supported by the computer.
Windows NT extender 11005 First showing up in WB 98A
New functions:
wntUserProps(s:server-name, s:user-name, i:request)
Returns information about a network user.
"server-name" is the name of the server on which the function will
execute, or a blank string ("") to indicate the current machine.
"user-name" is the name of a user who has an account on "server-name".
"request" specifies the information to be returned, and can be one
of the following:
Value Returns
----- -------
0 Username
1 Full name
2 Description
3 User profile path
4 Login script name
5 Home directory
6 Home directory logon drive
7 Privilege level ("GUEST", "USER", or "ADMIN")
Returns a string.
wntServerList(s:server-name, s:domain-name, i:server-type)
Lists servers in a domain.
See wntServiceAt for parameter information.
Returns a tab-delimited list of server UNC names (eg, "\\MYSERVER").
wntUserAdd(s:server-name)
Adds a user account.
"server-name" is the UNC name of the server on which the function
will execute (eg, "\\MYSERVER"), or "" for the local computer.
Before calling this function, you must use wntUserAddDat to set
parameters for the new user account. At a minimum, you must set the
"name" element. The other elements will receive default values.
Calling this function does not reset elements in the user parameter
structure. So, you can set various elements, add a user, then change
just the "name" element and add another user. All other elements
will retain their previous values. To clear all elements, call
wntUserAddDat specifying blank strings for "variable" and "value".
Example:
wntUserAddDat("name", "jdoe")
wntUserAddDat("full_name", "John Doe")
wntUserAdd("")
Returns 1.
wntUserAddDat(s:element, s/i:value)
Sets parameter information for wntUserAdd.
This function sets values for elements in a user parameter structure,
which is used by the wntUserAdd function.
"element" can be one of the following elements in the structure. Its
type (string or integer) is shown in parentheses, followed by a
description of its corresponding "value":
"name" (s):
Specifies the name of the user account. The number of characters in
the name cannot exceed 256.
"password" (s):
The password for the user specified in the "name" element. The length
cannot exceed 256 bytes. By convention, Windows NT limits the length
of passwords to 14 characters. This convention allows LAN Manager,
Windows 3.x, Windows for Workgroups 3.x, and Windows 95 clients to
access a Windows NT server using the account.
"home_dir" (s):
Points to a string containing the path of the home directory of the
user specified in "user_name". The string can be null.
"comment" (s):
Points to a string that contains a comment. The string can be a null
string, or it can have any number of characters before the
terminating null character.
"flags" (i):
Contains values that determine several features. This element can be
any of the following values:
Value Name Meaning
----- ---- -------
2 UF_ACCOUNTDISABLE The user's account is disabled.
8 UF_HOMEDIR_REQUIRED The home directory is required. This value is
ignored in Windows NT.
16 UF_LOCKOUT The account is currently locked out.
32 UF_PASSWRD_NOTREQD No password is required.
64 UF_PASSWRD_CANT_CHANGE The user cannot change the password.
The following values describe the account type. Only one value can be set.
Value Name Meaning
----- ---- -------
256 UF_TEMP_DUPLICATE_ACCOUNT This is an account for users whose primary
account is in another domain. This
account provides user access to this
domain, but not to any domain that trusts
this domain. The User Manager refers to
this account type as a local user account.
512 UF_NORMAL_ACCOUNT This is a default account type that
represents a typical user.
2048 UF_INTERDOMAIN_TRUST_ACCOUNT This is a permit to trust account for a
Windows NT domain that trusts other
domains.
4096 UF_WORKSTATION_TRUST_ACCOUNT This is a computer account for a Windows
NT Workstation or Windows NT Server that
is a member of this domain.
8192 UF_SERVER_TRUST_ACCOUNT This is a computer account for a Windows
NT Backup Domain Controller that is a
member of this domain.
"script_path" (s):
Points to a string specifying the path of the user's logon script,
.CMD, .EXE, or .BAT file. The string can be null.
"full_name" (s):
Points to a string that contains the full name of the user. This
string can be a null string, or it can have any number of characters
before the terminating null character.
"usr_comment" (s):
Points to a string that contains a user comment. This string can be
a null string, or it can have any number of characters before the
terminating null character.
"workstations" (s):
Points to a string that contains the names of workstations from which
the user can log on. As many as eight workstations can be specified;
the names must be separated by commas (,). If you do not want to
restrict the number of workstations, use a null string. To disable
logons from all workstations to this account, set the
UF_ACCOUNTDISABLE (2) value in the "flags" element.
"acct_expires" (i):
Specifies when the account will expire. This value is stored as the
number of seconds elapsed since 00:00:00, January 1, 1970. A value
of -1 indicates that the account never expires.
"max_storage" (i):
Specifies the maximum amount of disk space the user can use. Use -1
to use all available disk space.
"logon_hours" (s):
This is a 42-byte string that specifies the times during which the
user can log on. Each byte is a hexadecimal character ('0' - 'F')
which represents 4 bits of a 168-bit string. Each bit represents
a unique hour in the week. The first bit is Sunday, 0:00 to 0:59;
the second bit is Sunday, 1:00 to 1:59; and so on. Specify a blank
string ("") to indicate that there is no time restriction.
Note: Bit 0 represents Sunday from 0:00 to 0:59 only if you are in
the GMT time zone. In all other cases you must adjust the bits
according to your time zone offset (for example, GMT minus 8 hours
for PST).
"country_code" (i):
Specifies the country code for the user's language of choice.
"code_page" (i):
Specifies the code page for the user's language of choice.
"profile" (s):
Specifies a path to the user's profile. This value can be a null
string, a local absolute path, or a UNC path.
"home_dir_drive" (s):
Specifies the drive letter assigned to the user's home directory for
logon purposes.
"password_expired" (i):
Determines whether the password of the user has expired. Specify
nonzero to indicate that the user must change password at next logon.
If "variable" and "value" are both set to blank strings (""), all
values will be cleared from the user parameter structure.
You can specify a value of "*NULL*" to set a string element to a NULL
pointer, which is not the same as a NULL string ("").
Returns @TRUE on success, @FALSE if there was a problem.
wntUserDel(server-name, user-name)
Deletes a user account.
"server-name" is the UNC name of the server on which the function
will execute (eg, "\\MYSERVER"), or "" for the local computer.
"user-name" is the name of the user to be deleted.
Returns 1.
wntServerType(s:server-name)
Returns a server's platform.
"server-name" is the UNC name of a server (eg, "\\SERVER1"), or a
blank string ("") to indicate the local machine.
Returns one of the following values:
Value Meaning
----- -------
0 Invalid server name
1 Other
2 Windows for Workgroups
3 Windows 95 or later
4 Windows NT
wntServiceInf(s:server-name)
Returns a server's type.
"server-name" is the UNC name of a server (eg, "\\SERVER1"), or a
blank string ("") to indicate the local machine.
Returns a bitmask indicating the type of server, or 0 on error. The
individual flag bits in the bitmask can be extracted using the binary
AND ("&") operator.
See the "server-type" parameter in wntServiceAt for a list of flag bits.
wntUserGetDat(s:server-name, s:user-name, s:element)
Returns parameter information for a user account.
"server-name" is the UNC name of the server on which the function
will execute (eg, "\\MYSERVER"), or "" for the local computer.
"user-name" is the name of a user who has an account on "server-name".
"element" specifies the element to be returned. See wntUserAddDat
for a list of valid elements.
Returns a string or integer value, depending on "element".
wntUserSetDat(s:server-name, s:user-name, s:element, s/i:value)
Modifies parameter information for a user account.
"server-name" is the UNC name of the server on which the function
will execute (eg, "\\MYSERVER"), or "" for the local computer.
"user-name" is the name of a user who has an account on "server-name".
"element" specifies the element to be modified. See wntUserAddDat
for a list of valid elements.
"value" specifies the new value to be assigned to "element". See
wntUserAddDat for more information.
Returns @TRUE on success, @FALSE if there was a problem.
wntUserRename(s:server-name, s:old-username, s:new-username)
Renames a user account.
"server-name" is the UNC name of the server on which the function
will execute (eg, "\\MYSERVER"), or "" for the local computer.
"old-username" is an existing account name.
"new-username" is the new name to be given to the account.
Returns @TRUE on success, @FALSE if there was a problem.
In wntAccessAdd and wntAccessDel, added additional values for "object-type":
301 directory in an NTFS partition, and all its subdirectories
302 directory in an NTFS partition, and all files in the directory
303 directory in an NTFS partition, and all its subdirectories, and
all files in the directory and all its subdirectories
401 registry key, and all its subkeys
wntFileClose now closes all connections to a file, instead of just the
first one. It also now returns the number of connections which existed
(and were closed) for the specified file.
wntChgPswd can now be used to specify a new password without knowing the
old password, if you are a member of the Administrators or Account
Operators local group. To do this, specify "*UNKNOWN*" as the old
password. In this case, the "user" parameter must specify an actual user
name (ie, it cannot be a blank string).
Windows 32 extender 11001 First showing up in WB 98A
NetWare 3 extender 12021 First showing up in WB 98A
NetWare 4 extender 14019 First showing up in WB 98A
New function:
n4SetContext(s:context, s:tree)
Changes the current user's default context and/or tree.
"context" is a Directory Services context to be set. If this
parameter is a blank string (""), the context will not be changed.
"tree" is a Directory Services tree to be set. If this parameter is
a blank string (""), the tree will not be changed.
Note: the "tree" parameter is available only in the 32-bit version,
and is ignored in the 16-bit version.
This function changes the NetWare context and/or tree that is used by
subsequent function calls from this extender (for those functions
which do not take an explict "context" or "tree" parameter).
Returns 1.
n4ObjectProps now supports integer values, and some (but not all) other
non-string value types. Unsupported types will now be returned as blank
strings ("").
WB 98B Jun 24, 1998
The compiler now allows you to embed the WinBatch OLE support DLL when
compiling a large EXE (select "Ole 2.0 Automation Extender" from the
"Extenders" dialog box).
In 32-bit version, the compiler now allows you to specify a tech support
URL (web page) to be used if an error occurs in the script (under
"Settings"). This can be overridden using IntControl(50).
In 32-bit version, the compiler now allows you to specify version
information strings to be embedded in the EXE (under "Version Info").
The compiler now creates a configuration file for each source file you
compile. It will be placed in the same directory as the source file, and
will have the same base name with an extension of ".CMP". For example, if
you compile "C:\UTIL\TEST.WBT", it will create a configuration file named
"C:\UTIL\TEST.CMP".
The compiler now allows you to specify additional files to be embedded in
a large EXE (under "Other files").
The compiler no longer supports automatic batch mode. If you run it with
command-line parameters, it will bring up the interactive interface with
the specified source file and output type pre-selected.
The ".DAT" file format for extenders to be embedded by the compiler has
changed. The new format is a text file with the first line being the
description of the file, and one or more additional lines listing files
to be embedded. The files may contain a full path; if a file doesn't have
path information, the compiler will look for it first in the compiler
directory, then on the path. For example:
Novell NetWare 4.x
wwn4z32i.dll
wwn4z16i.dll
For backwards compatability, the second line of the .DAT file may contain
a list of files, delimited by commas.
In 32-bit version, the compiler now supports embedded file names longer than
16 characters, and no longer converts embedded file names to upper case.
In 32-bit version, the compiler now has an option to have the script run
hidden (under "Settings").
Changed BoxNew so that if you create a new box which covers or overlaps an
existing box, the most recently created box will be on top.
DLL 2.5bbq First showing up in WB 98B
New functions:
BinaryTagInit(i:buffer, s:start-tag, s:end-tag)
Initializes a binary tag operation.
Returns a binary tag structure string, or "" on failure.
BinaryTagFind(s:tag-struct)
Finds the next binary tag.
Returns a binary tag structure string, or "" on failure.
BinaryTagExtr(s:tag-struct, i:flags)
Returns the text between the last-returned pair of binary tags.
Flags Meaning
----- -------
1 Strip out tabs, carriage returns, and line feeds.
Returns the text, or "" on failure.
BinaryTagRepl(s:tag-struct, s:new-string)
Replaces a binary tag with text.
Returns a binary tag structure string, or "" on failure.
BinaryIndexEx(handle, offset, string, direction, i:match-case)
Searches a buffer for a string.
This function is almost the same as BinaryIndex (if "match-case" =
FALSE) and BinaryIndexNc (if "match-case" = TRUE). The one
difference: if the specified string is not found, this function
returns -1 (unlike those other functions, which return 0).
ItemSortNc(list, delimiter)
Sorts a list, ignoring case.
This function is the same as ItemSort, but is not case sensitive.
In 32-bit version of FileVerInfo, if you specify a blank string for
"language-key", it will try to look up the item under the following
language keys, in the specified order:
Language-key Language Character Set
------------ -------- -------------
040904E4 U.S. English Windows Multilingual
040904B0 U.S. English Unicode
000004E4 Neutral Windows Multilingual
04090000 U.S. English Neutral
00000000 Neutral Neutral
In 32-bit version, changed method for converting floating point numbers to
strings. The new method should produce fewer anomolies, but in some cases
the results will be slightly different than the previous method.
Fixed problem with BinaryPokeStr letting you store a string that was one
byte larger than the size of the buffer.
Fixed problem with BinaryIndex and BinaryIndexNc failing if the string was
found at the very end of the text in the buffer (ie, right before the EOD).
WinActivate no longer resets a window's "stay-on-top" attribute.
Fixed a problem in dialog boxes, where pressing the "Enter" key would
sometimes select the "OK' button instead of the highlighted pushbutton.
Fixed a problem with OLE calls causing a 3130 error if they were supposed to
return an object handle, but the function call failed (ie, returned 0), and
the return value was not assigned to a WIL variable in the script.
The built-in variables "param1" through "param9" are now correctly undefined
for parameters which are not passed, when making multiple Call's.
Added 2 additional activation methods to IntControl(61) and IntControl(62):
P1 Method to use
-- -------------
3 Change foreground lock timeout.
4 Attach to the input thread of the foreground window.
Changed the default method in Windows 98 and NT 5.0 to "3".
AskDirectory now handles "start-dir" having a trailing backslash.
NetWare 3 extender 12022 First showing up in WB 98B
New functions:
n3FileTimeGet(s:filename, i:time-field)
Gets Netware time information for a file.
"filename" must specify a single file name (no wildcards).
"time-field" can be one of the following:
1 file created
2 file last modified
3 file last accessed
4 file last archived
Returns the requested file time in YmdHms format (with a 4-digit
year), or a blank string ("") if the requested time field is not set.
n3DirTimeGet(s:dirname, i:time-field)
Gets Netware time information for a directory.
"dirname" must specify a single directory name (no wildcards).
"time-field" can be one of the following:
1 directory created
2 directory last modified
3 --- (not used)
4 directory last archived
Returns the requested directory time in YmdHms format (with a 4-digit
year), or a blank string ("") if the requested time field is not set.
NetWare 4 extender 14020 First showing up in WB 98B
n4FileTimeGet(s:filename, i:time-field)
Gets Netware time information for a file.
"filename" must specify a single file name (no wildcards).
"time-field" can be one of the following:
1 file created
2 file last modified
3 file last accessed
4 file last archived
Returns the requested file time in YmdHms format (with a 4-digit
year), or a blank string ("") if the requested time field is not set.
n4DirTimeGet(s:dirname, i:time-field)
Gets Netware time information for a directory.
"dirname" must specify a single directory name (no wildcards).
"time-field" can be one of the following:
1 directory created
2 directory last modified
3 --- (not used)
4 directory last archived
Returns the requested directory time in YmdHms format (with a 4-digit
year), or a blank string ("") if the requested time field is not set.
Fixed problem with n4MemberSet not completely adding the user to the group.
Fixed problem with n4MemberDel deleting all members in the specified group.
WB 98C Sep 18, 1998
New IntControl:
IntControl(1007, p1, p2, p3, p4) (32-bit only) (Requires Windows 95+ or NT 4.0+)
Add/remove/check tray icon.
p1 Meaning
-- -------
0 Check whether tray icon has been clicked (and reset "clicked" state)
1 Add currently-running script to the system tray
2 Remove currently-running script from the system tray
If p1 == 1 (add icon), then p2 can be one or more of the following
flags, combined with the binary OR ("|") operator:
p2 Meaning
-- -------
1 Hide regular WinBatch icon while the icon is in the system tray
2 Suspend script until user clicks on the tray icon
p3 = Tool tip (ie, string that is displayed when the mouse passes
over the tray icon), or "" for none.
p4 = Icon file, or "" for the default icon. If a file name is
specified, it can be a .ICO file, or an .EXE or .DLL (or similar
resource file) containing icons. If it is a resource containing
multiple icons, by default the first icon in the file is used.
You can specify a different icon using the following format:
"filename|#"
where "filename" is the name of the file, followed by a vertical
bar and then the offset of the desired icon in the file ("#").
The first icon in a file has an offset of 0. If an invalid icon
file is specified, the default icon will be used.
If the "suspend script" flag is specified in p2, then the WinBatch
script will be suspended until the user clicks on the tray icon, at
which point the script will continue, and this function will return
one of the click valuess listed below. Otherwise, the WinBatch
script will continue running, and you can periodically check to see
whether the user has clicked on the tray icon by calling this
function with p1 == 0.
When called with p1 == 0 (or when returning from being suspended),
this function will return one of the following values:
Value Meaning
----- -------
0 Not clicked
1 Left click
2 Right click
Each time you call this function with p1 == 0, the "click state"
will be reset to 0 (not clicked).
Returns @TRUE (success) or @FALSE (failure), or a click value.
Example:
IntControl(1007, 1, 2, "Click me!", "shell32.dll|41")
Fixed problem with compiler displaying an "Uninitialized variable" error if
certain options were chosen, and there was no "LastSource=" setting in the
compiler section of WWW-PROD.INI (which would have been the case if this
was the first time the compiler was run).
The #include directive will now also look for the specified file (if it
does not contain path information) in the same directory as the script
file being run or compiled
Fixed problem with the compiler always using ".EXE" as the extension when
reloading previous configurations, even when the output was a .WBC file.
DLL 2.5cbq First showing up in WB 98C
New Functions:
FileCopyAttr(source-list, destination, warning, s:attributes)
Copies files, and sets file attributes.
This function is like FileCopy, but takes an additional parameter
which lets you specify the file attributes for the destination files.
It is equivalent to doing a FileCopy, followed by a FileAttrSet.
If "attributes" is a blank string (""), the destination file(s) will
inherit the same attributes as the corresponding source file(s). You
only need to specify those attributes which you want to be changed.
See FileCopy and FileAttrSet for additional information.
FileMoveAttr(source-list, destination, warning, s:attributes)
Moves files, and sets file attributes.
This function is like FileMove, but takes an additional parameter
which lets you specify the file attributes for the destination files.
It is equivalent to doing a FileMove, followed by a FileAttrSet.
If "attributes" is a blank string (""), the destination file(s) will
inherit the same attributes as the corresponding source file(s). You
only need to specify those attributes which you want to be changed.
See FileMove and FileAttrSet for additional information.
TimeDiff(s:time-value-1, s:time-value-2)
Returns the difference between two points in time.
"time-value-1" and "time-value-2" must be valid date-time strings,
in YmdHms format. "time-value-1" must be the later (more recent) of
the two times.
Returns the difference between the two times, in YmdHms format.
Because some months have more days than others, an adjustment may
need to be made when converting the resulting "day" field into
months. In the example:
TimeDiff("1998:09:30:00:00:00", "1998:08:31:00:00:00")
the result is, logically, "0000:00:30:00:00:00" (30 days). But in
this example:
TimeDiff("1998:10:01:00:00:00", "1998:08:31:00:00:00")
where the operation wraps past the end of the month, there is some
question what the result should be, since there is no such date as
September 31. This function handles this by treating the period
from August 31 to September 30 as one month, so the result would be
"0000:01:01:00:00:00" (one month and one day).
Example:
; How long has it been since the beginning of the decade
diff = TimeDiff(TimeYmdHms(), "1990:01:01:00:00:00")
New IntControls:
IntControl(63, p1, p2, p3, p4)
Sets coordinates for AskFileText and AskItemList windows.
This function sets the window coordinates for the dialog displayed
by the next AskFileText or AskItemList function call. The coordinates
will be reset to default values after the Ask[..] function is called.
Coordinates are based on a virtual 1000 x 1000 screen:
p1 = left (upper-x)
p2 = top (upper-y)
p3 = right (lower-x)
p4 = bottom (lower-y)
To explicitly indicate that default values should be used, use:
IntControl(63, 0, 0, 0, 0)
Returns 1.
IntControl(64, 0, 0, 0, 0) (32-bit only)
Gets the exit code returned by the last program run.
This function gets the exit code (also known as the "errorlevel")
that was returned by the program that was most-recently run using
RunWait (or using RunShell with the @WAIT flag specified). If no
program has been run, or if the last-run program was not run in
@WAIT mode, this function will return 99999.
The windows displayed by AskFileText and AskItemList can now be resized
by the user.
In 32-bit version, the "Tile" parameter of the Wallpaper() function has a
new option:
2 = Stretch
This is available in Windows 98, and in Windows 95 with "Plus" installed.
Fixed a problem in dialog boxes, where pressing a hotkey corresponding to
the "OK" button (ie, the pushbutton with a value of 1) would select the
highlighted pushbutton instead, if the highlighted pushbutton was the
first control in the dialog and the focus had not previously been switched
away from it.
In 32-bit version, fixed problems with floating point to string conversions.
Fixed problem (again) with TimeSubtract, where the result could have a day
of "00" (eg, "96:04:00" instead of "96:03:31").
The existing documentation is not clear on the purpose or usage of the
TimeSubtract function. TimeSubtract is designed to subtract a
time-difference from a time-value:
TimeSubtract(s:time-value, s:time-difference)
"time-value" is a valid date-time string, in YmdHms format.
"time-difference" is an amount of time to be subtracted from
"time-value", in YmdHms format.
The result is a time string in YmdHms format.
Examples:
; Subtract 1 day from 9/1/98 (at midnight)
TimeSubtract("1998:09:01:00:00:00", "00:00:01:00:00:00")
; Subtract 48 hours from the current time
TimeSubtract(TimeYmdHms(), "00:00:00:48:00:00")
TimeSubtract is NOT designed to determine the difference between two
points in time. For that, use TimeDiffDays, TimeDiffSecs, or the new
TimeDiff function (above).
Adjusted the way TimeAdd and TimeSubtract deal with cases where you are
adding or subtracting a certain number of months, and the result would
be an invalid date. For example:
TimeAdd("1998:08:31:00:00:00", "00:01:00:00:00:00")
Here, you are asking to add one month to August 31, but there are only
30 days in September and therefore there is no September 31. In previous
versions, the result would have been October 1 (ie, there are 31 days in
August, so add 31 days). In this new version, it will no longer wrap the
month add/subtract operation past the end of a month, so the result will
now be September 30. Similarly, in this example:
TimeSubtract("1998:10:31:00:00:00", "00:01:01:00:00:00")
which subtracts one month and one day from October 31, the result will
now be September 29, not September 30. That is to say, it first
subtracts the month(s), adjusts the result to the last day of the month
if necessary, and then subtracts the day(s) (and hours, minutes, seconds).
In 32-bit version, added an additional option to IntControl(28):
2 = GUI font (Windows 95+ and NT 4.0+ only)
Note that this option applies to AskLine (and AskPassword), as well
as to AskFileText and AskItemList.
BinaryClipGet now stops reading clipboard data at the first NULL
character for text format types (1, 7, and 13).
BinaryClipPut now adds a NULL terminator to the data being written to
the clipboard for text format types (1, 7, and 13).
Windows NT extender 11006 First showing up in WB 98C
New functions:
wntRasUserGet(s:server-name, s:user-name, i:request)
Gets RAS information for a user.
"server-name" is the UNC name of the primary or backup domain
controller that has the user account database (eg, "\\MYSERVER").
If the machine on which the user account resides is a standalone
NT workstation or server, you can specify the UNC name of that
machine, or "" for the local computer.
"user-name" is the name of a user.
"request" specifies the information to be returned, and can be one
of the following:
Value Returns
----- -------
1 (i) Dial-in privilege
2 (s) Callback phone number
Dial-in privilege specifies both the dialin permission and the
callback mode, and will be one of the following values:
Value Meaning
----- -------
1 No dial-in permission / No callback privilege
2 No dial-in permission / Callback number specified by caller
4 No dial-in permission / Callback number preset by administrator
9 Dial-in permission / No callback privilege
10 Dial-in permission / Callback number specified by caller
12 Dial-in permission / Callback number preset by administrator
wntRasUserSet(s:server-name, s:user-name, i:privilege, s:phone-number)
Sets RAS information for a user.
"phone-number" specifies an administrator-preset callback phone
number, if appropriate. You can specify a blank string ("") to
leave the currently-set number (if any) unchanged.
See wntRasUserGet for additional information.
Returns 1.
wntRunAsUser(s:domain/server, s:user-name, s:password, i:login-type, i:flags)
Run as a different user.
"domain/server" is the name of the domain or server on which the
specified user account resides, or "." to indicate that the local
account database should be searched for the user, or "" to indicate
that the local account database and (then) any trusted domain
account databases should be searched for the user.
"user-name" is the name of the user to run as.
"password" is the specified user's login password.
"login-type" can be one of the following:
Type Meaning
---- -------
2 Interactive login
3 Network login
4 Batch login
5 Service login
Note that the specified user must have the appropriate user rights
assigned to be able to log in as a batch job or service.
"flags" is currently unused, and should be set to 0.
This function causes the specified user to be impersonated only for the
duration of the currently-running instance of the WIL Interpreter.
In order to use this function, the currently-logged-in user must have the
"Act as part of the operating system" user right assigned. This can be
set from the "Policy" menu in the NT User Manager (note that the "Show
Advanced User Rights" option in the dialog box must be checked).
Returns 1.
WB 98D Sep 29, 1998
PopMenu now puts double-quotes around the menu file name when launching the
editor.
PopMenu now attempts to return the focus to the previously-active window after
executing a menu item.
DLL 2.6dbr First showing up in WB 98D
New functions:
DebugTrace(i:mode, s:log-file)
Outputs debug information to a file.
"mode" = @ON or @OFF. Default is @OFF.
"log-file" is the name of the file to which debug information will
be appended.
When debug trace mode is @ON, each command that is executed is written
to the specified log file, along with its return value.
WinItemProcID(i:process-id, i:flags, i:return-type)
Returns a list of windows for the specified process.
This function returns a list of top-level (parent) windows owned by
the process specified by "process-id".
A process-id can be obtained by launching an application with
RunShell and specifying @GETPROCID as the "waitflag" (see below).
"flags" can be 0, or one or more of the following values combined
with the binary OR ("|") operator:
Flag Meaning
---- -------
1 Include windows with blank titles
2 Include hidden windows
4 Include windows which are not enabled for keyboard and mouse input
8 Include windows with the title "WinOldAp"
"return-type" specifies the format in which the list of windows will
be returned, and can be one of the following:
Type Meaning
---- -------
0 Tab-delimited list of window ID's
1 Tab-delimited list of window titles
2 List of window titles and name ID's in the form:
"window1-name|window1-ID|window2-name|window2-ID|..."
Example:
procid = RunShell("calc.exe", "", "", @NORMAL, @GETPROCID)
If (procid != 0) && (procid != 1) ; if we got a valid process ID
winids = WinItemProcId(procid, 2, 0)
Message("Window ID(s)", winids)
Endif
You can now obtain the process ID of an application that is launched with
the RunShell function by specifying @GETPROCID as the "waitflag". This is
the same as specifying @NOWAIT, except that on success the function will
return the process ID of the application that was launched. This process
ID can be used with the WinItemProcID function (see above). The process
ID may be a negative number. If you use RunShell to launch a shortcut to
a special (non-executable) shortcut (eg, a dial-up networking item), a
process ID cannot be obtained. Instead, a 1 will be returned to indicate
success. In all cases, a return value of 0 indicates failure.
Fixed problem with TimeDiff returning a negative number for the month
field, in certain cases.
The date string returned by the FileTimeGet function now includes a 4-digit
year, if this was configured via Control Panel.
In 32-bit version, fixed problem assigning string properties to OLE objects
(they weren't being properly converted to Unicode, so looked like gibberish).
Fixed problem with NetInfo(1) missing some installed clients under Windows
95, in unusual cases.
Fixed problem with BinaryIndexEx returning 0 instead of -1, if the string
being searched for would extend beyond the limits of the binary buffer.
Windows NT extender 11007 First showing up in WB 98D
New function:
wntMemberLst2(server-name, group, group-type)
Lists all members of a user group, with domains.
This function is the same as wntMemberList, but returns a list of
users including their domains, in the form:
Domain\User
Added new "elements" to wntUserGetDat:
"last_logon" (s): last logon time, in "YYYY:MM:DD:hh:mm:ss" format
"last_logoff" (s): last logoff time, in "YYYY:MM:DD:hh:mm:ss" format
These times are maintained separately on each Backup Domain Controller
(BDC) in the domain. To get an accurate value, each BDC in the
domain must be queried, and the largest value is used.
The return value will always contain a 4-digit year. If no value is
available, "0000:00:00:00:00:00" is returned.
Note: These elements cannot be set using wntUserAddDat or wntUserSetDat.
Modified the format of the "acct_expires" element in wntUserAddDat,
wntUserGetDat, and wntUserSetDat. Previously, this was set and returned
as an integer representing the number of seconds since 1/1/70. It has
now been changed to a string in "YYYY:MM:DD:hh:mm:ss" format.
For wntUserGetDat, the return value will always contain a 4-digit year.
If the account has no expiration date, "0000:00:00:00:00:00" is returned.
For wntUserAddDat and wntUserSetDat, "value" must contain a 4-digit year,
and must appear in the precise format "YYYY:MM:DD:hh:mm:ss" (ie, exactly
19 characters long, with colons in exactly the right positions). To
indicate that the account should have no expiration date, specify
"0000:00:00:00:00:00".
WILX extender 11107 First showing up in WB 98D
Under Windows NT, xEjectMedia no longer returns an error or displays a
"Drive not ready" message if the drive is empty.
WB 98E Nov 9, 1998
Fixed a problem with PopMenu not setting the focus to the previously-active
window before executing a menu item.
WB 99A Jan 5, 1999
Added additional option for IntControl(1007):
p1 Meaning
-- -------
3 Suspend script until user clicks on the tray icon
This can be used at any point after a WinBatch script has already been
placed in the tray (with p1 == 1). When the user clicks on the tray
icon, it will return one of the click values as listed for p1 == 0.
Fixed problem with PopMenu where, if you clicked on the tray icon but didn't
select a menu item, the next few times you clicked on the tray icon the menu
would come up and then immediately disappear.
The compiler will now unconditionally extract embedded files (in the "Other
files" category), whether or not they already exist. They will be extracted
to the directory where the large EXE is located, or to the Windows directory
if the EXE is being run from a floppy disk or CD-ROM. As before, extender
DLL's will not be extracted if they already exist in the EXE directory or on
the path.
WinBatch can now run scripts larger than 64K.
Compiler can now compile scripts larger than 64K.
DLL 2.7abs First showing up in WB 99A
New function:
MouseCoords(s:win-name, s:child-win)
Returns coordinates of the mouse within a window.
This function returns the x and y coordinates of the mouse cursor,
relative to the window specified by "win-name" and "child-win".
These coordinates can be used by the MouseMove function. See
MouseMove for information on these parameters.
The coordinates are returned as a space-delimited string, in the form:
"x y"
Fixed a problem with several file functions, which occured if the current
directory was a UNC of the form "\\SERVER\SHARE\DIR[\...]" (not just
"\\SERVER\SHARE"), and the specified file name or wildcard did not contain
path information. This could cause a "File not found" type of error.
When a WIL script is manually terminated by the user (eg, by pressing
Ctrl-Break), it now displays the line that was being processed.
Added additional option to IntControl(62):
P1 Method to use
-- -------------
-2 Don't activate WIL dialog windows at all.
Added new request # to MouseInfo:
Req# Return value
---- ------------
7 returns mouse coordinates relative to the bounding rectangle of the
window under the cursor, in virtual (1000x1000) screen units.
Fixed problem with some of the Binary[..] functions crashing (instead of
returning an error) if an offset < 0 was specified.
In 32-bit version, changed the way the following string sorting and
comparison functions operate:
BinarySort
ItemSort
ItemSortNc
StrCmp
StriCmp
>, >=, <, and <= (operators)
Previously, they were sorting (or comparing) strings on a
character-by-character basis. They now perform a "word sort", which sorts
strings based on their collation sequence. Hyphens and apostrophes are
ignored, and all other non-alphanumeric characters are sorted before any
alphanumeric character.
Changed ItemSortNc so that, if the strings being sorted are the same on a
case-insensitive basis, they will then be sorted on a case-sensitive basis.
In 32-bit version, changed memory allocation for strings to be dynamic.
This means that you should no longer receive an error 3096 ("Out of memory
for strings"), unless Windows itself is completely out of memory (unlikely).
In the Dialog function, ampersands ("&") are now once again being converted
to underscores in static text and varying text fields.
In 32-bit version, increased limit for FileItemize and DirItemize lists from
32K to 1MB.
Fixed a problem with menu parsing if you had a third-level menu followed
by a top-level menu.
OLE functions now support in-process servers.
Fixed a problem with MouseClick not sending the correct types of clicks.
Fixed an intermittent OLE crash problem.
OLE now supports properties with parameters.
Windows NT extender 11008 First showing up in WB 99A
New functions:
wntUserExist(s:server-name, s:user-name)
Determines whether a user exists.
"server-name" is the UNC name of the server on which the function
will execute (eg, "\\MYSERVER"), or a blank string ("") to indicate
the current machine.
"user-name" is the name of a user who may have an account on "server-name".
Returns @TRUE if the specified user exists, @FALSE otherwise.
wntCurrUsers(s:server-name, s:flags)
Lists users currently logged into a server.
"server-name" is the UNC name of the server on which the function
will execute (eg, "\\MYSERVER"), or a blank string ("") to indicate
the current machine.
"flags" specifies the format of the returned names, and can be one
of the following:
0 account (eg, "johndoe")
1 domain\account (eg, "OFFICE\johndoe")
Returns a tab-delimited list.
wntFileUsers(s:server-name, s:file-pathname)
Lists network users who have a file open.
"server-name" is the UNC name of the server on which the function
will execute (eg, "\\MYSERVER"), or a blank string ("") to indicate
the current machine.
"file-pathname" is a fully-qualified file name (eg, "C:\DOC\MYFILE.TXT").
NOTE: The file name MUST be fully-qualified.
Returns a tab-delimited list of user names.
wntAcctInfo(s:server-name, s:account-name, i:request)
Returns information about a user account.
"server-name" is the UNC name of the server on which the function
will execute (eg, "\\MYSERVER"), or a blank string ("") to indicate
the current machine.
"account-name" is the name of a user who has an account on "server-name".
"request" specifies the information to be returned, and can be one
of the following:
Value Returns
----- -------
0 Domain where the specified account name is found
1 SID (security identifier), in standard text form
Returns a string.
wntGroupAdd(s:server-name, s:group-name, i:group-type, s:comment)
Creates a user group.
"server-name" is the UNC name of the server on which the function
will execute (eg, "\\MYSERVER"), or a blank string ("") to indicate
the current machine.
"group-name" is the name of the group to be created.
"group-type" can be @LOCALGROUP or @GLOBALGROUP.
"comment" is an optional description of the group, or "" for none.
Returns 1.
wntGetDrive(s:net-resource)
Lists local drives mapped to a UNC.
"net-resource" specifies a UNC, in the form "\\SERVER\SHARE". It is
not case-sensitive, but must otherwise EXACTLY match the UNC name to
which the drive(s) are mapped (eg, must not have a trailing backslash).
Returns a tab-delimited list of drives (eg, "H: W:").
wntSvcCfgGet(s:server, s:service-name, i:flags, i:request)
Gets a configuration parameter for a service.
"request" specifies the parameter to be returned, and can be one
of the following:
0 i:ServiceType
1 i:StartType
2 i:ErrorControl
3 s:BinaryPathName
4 s:LoadOrderGroup
5 i:TagId
6 s:Dependencies
7 s:ServiceStartName
8 (unused)
9 s:DisplayName
Further information on these values follows:
ServiceType:
One of the following service type flags to indicate the type of service. In addition,
for a SERVICE_WIN32 service, the SERVICE_INTERACTIVE_PROCESS flag might be set,
indicating that the service process can interact with the desktop:
Value Name Meaning
----- ---- -------
1 SERVICE_KERNEL_DRIVER Windows NT device driver.
2 SERVICE_FILE_SYSTEM_DRIVER Windows NT file system driver.
16 SERVICE_WIN32_OWN_PROCESS Win32 service that runs in its own process.
32 SERVICE_WIN32_SHARE_PROCESS Win32 service that shares a process with other services.
256 SERVICE_INTERACTIVE_PROCESS Win32 service process that can interact with the desktop.
StartType:
Specifies when to start the service. One of the following values is specified:
Value Name Meaning
----- ---- -------
0 SERVICE_BOOT_START Device driver started by the operating system loader. This
value is valid only if the service type is
SERVICE_KERNEL_DRIVER or SERVICE_FILE_SYSTEM_DRIVER.
1 SERVICE_SYSTEM_START Device driver started by the IoInitSystem function. This
value is valid only if the service type is
SERVICE_KERNEL_DRIVER or SERVICE_FILE_SYSTEM_DRIVER.
2 SERVICE_AUTO_START Device driver or Win32 service started by the service
control manager automatically during system startup.
3 SERVICE_DEMAND_START Device driver or Win32 service started by the service
control manager when a process calls the StartService function.
4 SERVICE_DISABLED Device driver or Win32 service that can no longer be started.
ErrorControl:
Specifies the severity of the error if this service fails to start during startup, and
determines the action taken by the startup program if failure occurs. One of the
following values can be specified:
Value Name Meaning
----- ---- -------
0 SERVICE_ERROR_IGNORE The startup (boot) program logs the error but continues
the startup operation.
1 SERVICE_ERROR_NORMAL The startup program logs the error and displays a message
box pop-up but continues the startup operation.
2 SERVICE_ERROR_SEVERE The startup program logs the error. If the last-known
good configuration is being started, the startup operation
continues. Otherwise, the system is restarted with the
last-known-good configuration.
3 SERVICE_ERROR_CRITICAL The startup program logs the error, if possible. If the
last-known good configuration is being started, the startup
operation fails. Otherwise, the system is restarted with
the last-known good configuration.
BinaryPathName:
The fully qualified path to the service binary file.
LoadOrderGroup:
The load ordering group of which this service is a member. If a blank string, the service
does not belong to a group. The registry has a list of load ordering groups located at:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ServiceGroupOrder
The startup program uses this list to load groups of services in a specified order with
respect to the other groups in the list. You can place a service in a group so that
another service can depend on the group. The order in which a service starts is
determined by the following criteria:
1. The order of groups in the registry’s load-ordering group list. Services in groups
in the load-ordering group list are started first, followed by services in groups
not in the load-ordering group list and then services that do not belong to a group.
2. The service’s dependencies listed in the "Dependencies" parameter and the
dependencies of other services dependent on the service.
TagId:
Specifies a unique tag value for this service in the group specified by the
"LoadOrderGroup" parameter. A value of zero indicates that the service has not been
assigned a tag. You can use a tag for ordering service startup within a load order
group by specifying a tag order vector in the registry located at:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GroupOrderList
Tags are only evaluated for SERVICE_KERNEL_DRIVER and SERVICE_FILE_SYSTEM_DRIVER type
services that have SERVICE_BOOT_START or SERVICE_SYSTEM_START start types.
Dependencies:
A tab-delimited list of names of services or load ordering groups that must start before
this service. If a blank string, the service has no dependencies. If a group name is
specified, it must be prefixed by a '+' character to differentiate it from a service name,
because services and service groups share the same name space. Dependency on a service
means that this service can only run if the service it depends on is running. Dependency
on a group means that this service can run if at least one member of the group is running
after an attempt to start all members of the group.
ServiceStartName:
If the service type is SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS, this
name is the account name in the form of "DomainName\Username", which the service process
will be logged on as when it runs. If the account belongs to the built-in domain,
".\Username" can be specified. If a blank string, the service will be logged on as the
LocalSystem account.
If the service type is SERVICE_KERNEL_DRIVER or SERVICE_FILE_SYSTEM_DRIVER, this name is
the Windows NT driver object name (that is, \FileSystem\Rdr or \Driver\Xns) which the
input and output (I/O) system uses to load the device driver. If a blank string, the
driver is run with a default object name created by the I/O system based on the service name.
DisplayName:
String that is to be used by user interface programs to identify the service. This
string has a maximum length of 256 characters. The name is case-preserved in the
service control manager. Display name comparisons are always case-insensitive.
See wntSvcStart for additional parameter information.
Returns a string or integer value.
wntSvcCfgSet(s:server, s:service-name, i:flags, i:request, s/i:value)
Changes a configuration parameter for a service.
"request" specifies the parameter to be changed, and can be one
of the following:
0 i:ServiceType
1 i:StartType
2 i:ErrorControl
3 s:BinaryPathName
4 s:LoadOrderGroup
5 (unused)
6 s:Dependencies
7 s:ServiceStartName
8 s:Password
9 s:DisplayName
Most of these are documented under wntSvcCfgGet, with the exception of:
Password:
Password to the account name specified by the "ServiceStartName" parameter if the service
type is SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS. If a blank string, the
service has no password. If the service type is SERVICE_KERNEL_DRIVER or
SERVICE_FILE_SYSTEM_DRIVER, this parameter is ignored.
"value" specifies the new value for the parameter.
See wntSvcCfgGet and wntSvcStart for parameter information.
Returns 1.
wntEventWrite(s:server-name, s:source-name, i:type/category, i:event-id, s:description)
Writes an entry to an NT event log.
"server-name" is the UNC name of the server on which the function
will execute (eg, "\\MYSERVER"), or a blank string ("") to indicate
the current machine.
"source-name" is a subkey of a logfile entry under the "EventLog"
key in the registry. For example, the source name "WinApp" would be
valid if the registry had the following form:
HKEY_LOCAL_MACHINE
System
CurrentControlSet
Services
EventLog
Application
WinApp
Security
System
If the source name cannot be found, the event logging service uses
the Application logfile with no message files for the event
identifier or category.
"type/category" consists of one value for "type" and one value for
"category", combined with the bitwise OR ('|') operator:
type: specifies the type of event being logged, and can be one of
the following values:
Value Meaning
----- -------
65536 EVENTLOG_ERROR_TYPE
131072 EVENTLOG_WARNING_TYPE
262144 EVENTLOG_INFORMATION_TYPE
524288 EVENTLOG_AUDIT_SUCCESS
1048576 EVENTLOG_AUDIT_FAILURE
category: specifies the event category. This is source-specific
information; the category can have any value (0 - 65535).
"event-id" specifies the event identifier. The event identifier
specifies the message that goes with this event as an entry in the
message file associated with the event source.
"description" is an optional string containing additional
information that will be stored with the event, or "".
Returns 1.
New audit functions:
wntAuditAdd(server-name, resource/share-name, user/group name, object-type, access-string)
Adds audit records for a resource.
wntAuditDel(server-name, resource/share-name, user/group name, object-type)
Removes audit records from a resource.
wntAuditGet(server-name, resource/share-name, user/group name, object-type)
Returns audit records for a resource.
wntAuditList(s:server-name, s:resource/share-name, i:object-type, i:flag)
Returns list of users who have audit records for a resource.
For the most part, the usage for these functions is the same as the
corresponding wntAccess[..] functions, except that these functions work
with audit records instead of access records. The differences are:
These audit functions do not support an "object-type" of 100, because
shares do not have audit records.
wntAuditAdd does not remove any existing audit records for the specified
user (or group). If you create multiple audit records for a user, it
will have a cumulative effect, and should not cause any problems. If
you wish to start with a "clean slate", use wntAuditDel first.
There are no predefined access types for wntAuditAdd. You will need
to specify the actual values for "access-string". The fields should
be set as follows:
"record-type" must be set to:
2 SYSTEM_AUDIT_ACE_TYPE
"access-flags" must contain one (or both) of these values:
64 SUCCESSFUL_ACCESS_ACE_FLAG
128 FAILED_ACCESS_ACE_FLAG
These specify whether this access string is enabling auditing for
success (64), failure (128), or both (192). You can specify
additional flags, by combining them with the bitwise OR ('|')
operstor.
"access-rights" are based on the same values as shown for wntAccessAdd.
One additional value that is specific to wntAuditAdd is:
16777216 ACCESS_SYSTEM_SECURITY
The values for "access-rights" which correspond to the checkboxes in
the Audit property dialogs in Windows NT are listed below. Note that
the appropriate values may vary depending on your system configuration,
or among different versions of Windows NT:
Directories/Files
-----------------
17957001 Read
17957142 Write
1179808 Execute
65536 Delete
262144 Change Permissions
524288 Take Ownership
Printers
--------
8 Print
16777220 Full Control
65536 Delete
262144 Change Permissions
524288 Take Ownership
Registry keys
-------------
1 Query Value
2 Set Value
4 Create Subkey
8 Enumerate Subkeys
16 Notify
32 Create Link
65536 Delete
262144 Write DAC
131072 Read Control
You can combine multiple values using the bitwise OR ('|') operator.
For example, to audit failed reads and writes for a file:
rights = 17957001 | 17957142
wntAuditAdd("", "f:\public\readme.txt", "Guests", 300, "2:128:%rights%")
Instead of manually creating "access-records" strings, you can use
the wntAuditGet function to return an "access-records" string in the
proper format to be used with wntAuditAdd. This can be useful for
duplicating audit records from one object or user to another.
The following changes have been made to wntRunAsUser:
After you use wntRunAsUser, any programs you launch via the Run[..] or
ShellExecute commands will be run in the context of the impersonated user.
In order for this to work, the currently logged-in user (not the user
being impersonated) needs to have the following privileges set:
Increase quotas
Replace a process level token
You can specify a user name of "" to end the impersonation.
The "flag" parameter can contain one or more of the following values,
combined using the bitwise OR ("|") operator:
Flag Meaning
---- -------
1 Allow new child processes to interact with the desktop
Fixed wntChgPassword when specifying an old-password of "*UNKNOWN*".
Functions which return a tab-delimited list no longer include a tab at
the end of the list.
Added new request to wntGroupInfo:
Req Returns
--- -------
2 i:group's RID (relative identifier)
This request is valid only with global groups.
Added new "element" to wntUserGetDat:
"user_id" (i): user's RID (relative identifier)
Note: This element cannot be set using wntUserAddDat or wntUserSetDat.
Added new "element" to wntUserGetDat and wntUserSetDat:
"primary_group_id" (i): RID (relative ID) of the user's primary global group
You can determine a group's RID using wntGroupInfo with request = 3.
Note: This element cannot be set using wntUserAddDat.
Windows 95 extender 11004 First showing up in WB 99A
New functions:
w95FileUsers(s:server-name, s:file-pathname)
Lists network computers who have a file open.
"server-name" is the name of the server on which the function will
execute, or a blank string ("") to indicate the current machine.
"file-pathname" is a fully-qualified file name (eg, "C:\DOC\MYFILE.TXT").
NOTE: The file name MUST be fully-qualified.
Returns a tab-delimited list of computer names.
w95GetDrive(s:net-resource)
Lists local drives mapped to a UNC.
"net-resource" specifies a UNC, in the form "\\SERVER\SHARE". It is
not case-sensitive, but must otherwise EXACTLY match the UNC name to
which the drive(s) are mapped (eg, must not have a trailing backslash).
Returns a tab-delimited list of drives (eg, "H: W:").
w95FileClose now closes all connections to a file, instead of just the
first one. It also now returns the number of connections which existed
(and were closed) for the specified file.
Functions which return a tab-delimited list no longer include a tab at
the end of the list.
Windows 9x extender 11001 First showing up in WB 99A
New function:
w9xOwnerGet(s:server-name, i:reg-key, s:resource-name, i:object-type, i:flag)
Returns the owner of an object.
See wntOwnerGet.
Functions which return a tab-delimited list no longer include a tab at
the end of the list.
NetWare 4 extender 14021 First showing up in WB 99A
New functions:
n4GetUserName(s:context)
Returns the name of the currently logged-in user.
"context" is a Directory Services context, or "" for the default context.
This function returns the name of the currently logged-in user, relative
to "context". This function uses Directory Services (unlike n4GetUser).
Returns a user name, or "" on error.
n4ObjGetVal(s:context, s:object, s:attribute)
Returns values for an object attribute.
"context" is a NetWare context, or "" for the current context.
"object" is the name of a NetWare object. It cannot be blank.
"attribute" is an attribute of "object".
This function is similar to n4ObjectProps, but returns more detail for
value types which are structures. For example, a FAX number type is
a structure which contains a phone number field and an optional
parameter field. n4ObjGetVal returns both fields, whereas n4ObjectProps
only returns the phone number.
Distinguished names are returned in abbreviated, typeless form.
By default, binary strings are returned as a hex string (a sequence of hex
bytes, with each byte in the original string represented by two hex characters
in the returned string. This can be changed with n4ObjOptions (below).
By default, multiple values for "attribute" are delimited with tabs,
and individual fields within a structure-type value are delimited with
vertical bars ('|'). This can be changed with n4ObjOptions (below).
Network addresses are returned in the form xxxxxxxx:xxxxxxxxxxxx:xxxx
File streams are not supported, and return a blank string.
This is an outline of the return format for various value types:
Type Format of returned data
---- -----------------------
EMail_Address type|address
Fax_Number telephoneNumber|parameters
Path nameSpaceType|volumeName|path
Po_Address line1|line2|line3|line4|line5|line6
Typed_Name objectName|level|interval
Back_Link remoteID|objectName
CI_List string|string|...
Object_ACL protectedAttrName|subjectName|privileges
Octet_List string|string|...
Hold objectName|amount
Replica_Pointer serverName|replicaType|replicaNumber|count|addressType|address
Net_Address addressType|address
NWDS_TimeStamp wholeSeconds|eventID
Unknown_Attr attrName|syntaxID|value
Returns a string, integer, or list.
n4ObjOptions(s:value-delim, s:field-delim, s:null-sub, i:flags, s:reserved)
Specifies options for n4ObjGetVal.
"value-delim" specifies a single character used to delimit multiple
values for an attribute. The default is a tab. Specify a blank
string ("") to leave unchanged.
"field-delim" specifies a single character used to delimit fields
within a structure-type value. The default is a vertical bar ('|').
Specify a blank string ("") to leave unchanged.
"null-sub" specifies a single character used to replace any NULL's
found within a binary string, when being returned as a regular string.
The default is a space (" "). Specify a blank string ("") to leave unchanged.
"flags" can be one or more of the following, combined with the
bitwise OR ('|') operator:
Flag Meaning
---- -------
1 Return binary strings as a regular string, instead of a hex
string. Any NULL's found within the binary string will be
replaced with the "null-sub" character.
"reserved" is currently unused, and should be set to a blank string ("").
Returns 1.
n4ObjectProps now handles all value types, except file streams.
Distinguished names are now returned in abbreviated, typeless form.
Binary strings are returned with any NULL's replaced by spaces. For
complex structure types (ie, not a single string or integer), the most
useful information from the structure is returned, in the best form
possible. To get all the data from such value types, use n4ObjGetVal.
Fixed a problem with n4NameConvert returning a typed name with format == 4.
WILX extender 11108 First showing up in WB 99A
Fixed xMessageBox so the message box will come the foreground in Windows
98 and NT 5.0.
WB 99B Jan 13, 1999
DLL 2.7bbs First showing up in WB 99B
Call() function now handles WBC (encoded) and WBE (encrypted) files created
with versions of the compiler prior to 99A.
WB 99C Jan 20, 1999
Fixed problem with large compiled EXE's giving a "DLL not found" error at
runtime if they contained (exactly) 4 extender DLL's.
Fixed problem with compiler causing an error when embedding "Other files"
that were 0 bytes in size.
DLL 2.7cbs First showing up in WB 99C
Fixed problem with BinaryTag[..] functions not being able to handle
binary buffers larger than 64K.
Windows NT extender 11009 First showing up in WB 99C
Fixed problem with DLL not loading on NT 3.51.
Note: wntRunAsUser requires NT version 4.0 or higher.
Fixed problem with DLL not loading if RASSAPI.DLL was not found.
Note: wntRasUserGet and wntRasUserSet require RASSAPI.DLL.
NetWare 3 extender 12023 First showing up in WB 99C
New function:
n3GetConnNum(s:server)
Gets the connection number for the current workstation.
This function returns the connection number for the current
workstation on the specified NetWare server. The connection
number is the index into the connection table maintained by the
server for all connected objects.
Returns a connection number on success, or -1 on failure.
NetWare 4 extender 14022 First showing up in WB 99C
New function:
n4GetConnNum(s:server)
Gets the connection number for the current workstation.
This function returns the connection number for the current
workstation on the specified NetWare server. The connection
number is the index into the connection table maintained by the
server for all connected objects.
Returns a connection number on success, or -1 on failure.
WB 99D Feb 11, 1999
The compiler now automatically compresses the WinBatch script and any
"Other files" when creating an EXE, and uncompresses them when the EXE is
run. This will cause the compile to take a bit longer, and may add a
slight delay at runtime (depending on the CPU speed and the size of the
files involved), but it will almost always result in smaller compiled EXE's.
DLL 2.8dbt First showing up in WB 99D
New IntControl:
IntControl(65, p1, 0, 0, 0)
Sets maximum line length for FileRead.
"p1" specifies the maximum length of a line which can be read using
the FileRead function, in bytes. This is also the number of bytes
which are buffered internally with each file read operation. The
default is 4096. You can specify a value of 0, in which case file
reads are not buffered internally, and the maximum line length is
1280 bytes (although this number is subject to change).
This IntControl affects subsequent FileOpen commands, and has no
effect on files which are already open.
Returns previous setting.
Fixed problem using the Call() function to call WBC files created with
older versions of the compiler (pre-99A). Very small files worked, but
files over a certain size caused a verification failure error message.
FileDelete now returns a "File cannot be deleted" error instead of "File
not found" if the specified file exists but cannot be deleted.
Optimized FileRead by using buffered reads (for files only, not for
pipes). The default buffer size is 4096 bytes, and this is also the
maximum length of a line which can be read. This size can be changed
using the new IntControl(65). Lines which are too long to be read will
return an error (instead of being truncated, as in previous versions).
If you do a BinaryTagFind followed by another BinaryTagFind, the second
BinaryTagFind will now search for the next tag. Previously, you had to do
a BinaryTagRepl before being able to search for the next tag.
Fixed a problem with the wildcard string functions (StrIndexWild,
StrLenWild, and StrSubWild) where the text would not match a pattern with
trailing asterisks, eg: StrIndexWild("abc", "abc*", 1).
DllCall no longer crashes if called with an insufficient number of
parameters.
Fixed a problem with OLE, where, if an OLE call returned a NULL OLE object
which you assigned to a variable, and then tried to assign a new value to
that variable, it would cause a "Bad OLE channel" error.
In 32-bit version, added a 1-second delay after a successful WinWaitExist,
WinWaitChild, and WinWaitClose.
Windows NT extender 11010 First showing up in WB 99D
Fixed problem where a wntUserExist which returned @FALSE could prevent
subsequent NT extender function calls from working properly.
NetWare 4 extender 14023 First showing up in WB 99D
Fixed problem with object names being returned with relative names instead
of canonical names in some cases.
WB 99E Apr 12, 1999
Fixed a problem with "#include" directives not working in executables
compiled with WinBatch 99D.
DLL 2.8ebt First showing up in WB 99E
In 32-bit version, changed floating point to string conversions, so that
results will now be returned in scientific format for numbers whose
absolute values are < 0.0001.
In 32-bit version, in the Decimals() function you can now specify these
values for "places":
Value Meaning
----- -------
-2 Use alternate method of converting to strings, with no trailing zeroes
-3 Always use scientific format
WB 99F Apr 23, 1999
Fixed problem with OLE not working from FileMenu.
Fixed problem with OLE not working from PopMenu.
DLL 2.8fbt First showing up in WB 99F
New IntControl:
IntControl(70, p1, 0, 0, 0) (32-bit only)
Set delay after WinWait[..] functions.
"p1" specifies the delay, in milliseconds, after a successful
WinWaitExist, WinWaitChild, and WinWaitClose. The default is 500
(ie, 1/2 second). Specify 0 for no delay.
Returns previous setting.
In 32-bit version, changed floating point to string conversions again.
If you have used the Decimals() function specifying a "places" value of 0
or higher, then results will no longer be returned in scientific format
for numbers whose absolute values are < 0.0001. Also, if you have
specified Decimals(0), then results will now be returned in scientific
format for numbers whose absolute values are > 2147483647.
DirRename was failing if the old and new names had drive letters that were
the same letter but one was upper case and the other was lower case.
In 32-bit version, there is a problem with IntControl(68) causing the
computer to reboot if it does not support the power-off feature. We've
added a new parameter to work around this:
P2 Meaning
-- -------
0 Power-off if supported by the computer (*see note below*)
1 Don't attempt to power-off
2 Attempt to power-off in any case
Note: We don't currently have a reliable method of determining if a
computer supports the power-off feature, so 0 will attempt to do a
power-off in any case.
In 32-bit version, changed the delay after a successful WinWaitExist,
WinWaitChild, and WinWaitClose, from 1 second to 1/2 second. This can be
changed or disabled with the new IntControl(70), above.
Windows NT extender 11011 First showing up in WB 99F
Fixed a rare problem with the extender crashing when making the first call
to any of the extender functions.
In wntSvcCfgSet, for request #7, if you specify "ServiceStartName" with no
password, the password will be set to a blank string (ie, same as
"ServiceStartName|"). To specify a non-blank password, use the form
"ServiceStartName|Password".
WB 99G May 7, 1999
DLL 2.8gbt First showing up in WB 99G
In 32-bit version, under Windows 95/98, fixed a problem using BinaryConvert
to convert a non-Unicode buffer to a Unicode buffer, while setting the flag
to specify that it also be converted to uppercase or lowercase. The
Unicode conversion was being performed properly, but the case conversion
was not. Note that under Windows 95/98, it is still not possible to
perform a case conversion of a Unicode buffer (ie, where "source-type" and
"target-type" are both Unicode). This is not a problem under Windows NT.
Improved DebugTrace, and fixed a problem with the last line in the script
not being output to the log file.
Fixed a problem with FileRead returning extra characters at the end of the
last line in the file, if the last line did not end with a line feed.
Increased the maximum number of extender entries from 200 to 500.
Windows NT extender 11012 First showing up in WB 99G
New functions:
wntWtsUserGet(s:server-name, s:user-name, i:request)
Gets user information from an NT Terminal Server.
Note: this function requires WTSAPI32.DLL to be present.
"server-name" is the name of a Windows-based Terminal Server or domain
controller, or "" to indicate the Terminal Server on which your
application is running.
"user-name" is a user name.
"request" specifies the information to get, and can be one of the following:
Request Setting
------- -------
1 (s) InitialProgram
2 (s) WorkingDirectory
3 (i) InheritInitialProgram
4 (i) AllowLogonTerminalServer
5 (i) TimeoutSettingsConnections
6 (i) TimeoutSettingsDisconnections
7 (i) TimeoutSettingsIdle
8 (i) DeviceClientDrives
9 (i) DeviceClientPrinters
10 (i) DeviceClientDefaultPrinter
11 (i) BrokenTimeoutSettings
12 (i) ReconnectSettings
13 (i) ModemCallbackSettings
14 (s) ModemCallbackPhoneNumber
15 (i) ShadowingSettings
16 (s) TerminalServerProfilePath
17 (s) TerminalServerHomeDir
18 (s) TerminalServerHomeDirDrive
19 (i) TerminalServerRemoteHomeDir
Information on these settings follows:
Request Setting
------- -------
1 (s) InitialProgram
A string containing the path of the initial program that
Terminal Services runs when the user logs on.
If the InheritInitialProgram value is 1, the initial
program can be any program specified by the client.
2 (s) WorkingDirectory
A string containing the path of the working directory
for the initial program.
3 (i) InheritInitialProgram
A flag that indicates whether the client can specify the
initial program.
Value Meaning
----- -------
0 The client cannot specify the initial program.
The InitialProgram string indicates the
initial program. If you specify a user's
initial program, that's the only program they
can run; Terminal Server logs off the user
when the user exits that program.
1 The client can specify the initial program.
4 (i) AllowLogonTerminalServer
A flag that indicates whether the user account is
permitted to log on to a Terminal Server.
Value Meaning
----- -------
0 The user cannot logon.
1 The user can logon.
5 (i) TimeoutSettingsConnections
A flag that specifies the maximum connection duration,
in minutes. One minute before the connection timeout
interval expires, the user is notified of the pending
disconnection. The user's session is disconnected or
terminated depending on the BrokenTimeoutSettings value.
Every time the user logs on, the timer is reset. A
value of zero indicates the connection timer is
disabled.
6 (i) TimeoutSettingsDisconnections
A flag that specifies the maximum duration, in minutes,
that a Terminal Server retains a disconnected session
before the logon is terminated. A value of zero
indicates the disconnection timer is disabled.
7 (i) TimeoutSettingsIdle
A flag that specifies the maximum idle time, in minutes.
If there is no keyboard or mouse activity for the
specified interval, the user's session is disconnected
or terminated depending on the BrokenTimeoutSettings
value. A value of zero indicates the idle timer is
disabled.
8 (i) DeviceClientDrives
Citrix ICA clients only: A flag that indicates whether
the Terminal Server automatically reestablishes client
drive mappings at logon.
Value Meaning
----- -------
0 The server does not automatically connect to
previously mapped client drives.
1 The server automatically connects to
previously mapped client drives at logon.
9 (i) DeviceClientPrinters
RDP 5.0 clients and Citrix ICA clients: A flag that
indicates whether the Terminal Server automatically
reestablishes client printer mappings at logon.
Value Meaning
----- -------
0 The server does not automatically connect to
previously mapped client printers.
1 The server automatically connects to
previously mapped client printers at logon.
10 (i) DeviceClientDefaultPrinter
RDP 5.0 clients and Citrix ICA clients: A flag that
indicates whether the client printer is the default
printer.
Value Meaning
----- -------
0 The client printer is not the default printer.
1 The client printer is the default printer.
11 (i) BrokenTimeoutSettings
A flag that indicates what happens when the connection
or idle timers expire or when a connection is lost due
to a connection error.
Value Meaning
----- -------
0 The session is disconnected.
1 The session is terminated.
12 (i) ReconnectSettings
A flag that indicates how a disconnected session for
this user can be reconnected.
Value Meaning
----- -------
0 The user can log on to any client computer to
reconnect to a disconnected session. Note
that sessions started at clients other than
the system console cannot be connected to the
system console, and sessions started at the
system console cannot be disconnected.
1 The user can reconnect to a disconnected
session by logging on to the client computer
used to establish the disconnected session.
If the user logs on from a different client
computer, the user gets a new logon session.
13 (i) ModemCallbackSettings
Citrix ICA clients only: A flag that indicates the
configuration for dialup connections in which the
Terminal Server hangs up and then calls back the client
to establish the connection.
Value Meaning
----- -------
0 Callback connections are disabled.
1 The server prompts the user to enter a phone
number and calls the user back at that phone
number. You can use the ModemCallbackPhoneNumber
value to specify a default phone number.
2 The server automatically calls the user back
at the phone number specified by the
ModemCallbackPhoneNumber value.
14 (s) ModemCallbackPhoneNumber
Citrix ICA clients only: A string containing the phone
number to use for callback connections.
15 (i) ShadowingSettings
RDP 5.0 clients and Citrix ICA clients: A flag that
indicates whether the user session can be shadowed.
Shadowing allows a user to remotely monitor the
on-screen operations of another user.
Value Meaning
----- -------
0 The session cannot be shadowed.
1 The session can be shadowed.
16 (s) TerminalServerProfilePath
A string containing the path of the user's profile for
Terminal Server logon.
17 (s) TerminalServerHomeDir
A string containing the path of the user's home
directory for Terminal Server logon. This string can
specify a local path or a UNC path (\\machine\share\path).
See TerminalServerRemoteHomeDir.
18 (s) TerminalServerHomeDirDrive
A string containing a drive letter to which the UNC path
specified in the TerminalServerHomeDir string is mapped.
See TerminalServerRemoteHomeDir.
19 (i) TerminalServerRemoteHomeDir
A flag that indicates whether the user's home directory
for Terminal Server logon is a local path or a mapped
drive letter.
Value Meaning
----- -------
0 The TerminalServerHomeDir string contains the
local path of the user's Terminal Server logon
home directory.
1 The TerminalServerHomeDir string contains the
UNC path of the user's Terminal Server logon
home directory, and the TerminalServerHomeDirDrive
string contains a drive letter to which the
UNC path is mapped.
Returns a string or integer, depending on "request".
wntWtsUserSet(s:server-name, s:user-name, i:request, s/i:value)
Modifies user information on an NT Terminal Server.
Note: this function requires WTSAPI32.DLL to be present.
"value" specifies the new value to be set.
See wntWtsUserGet for additional parameter information.
Returns 1.
In wntMemberGet, if "group-type" is @LOCALGROUP, then "user" can now be
specified as either "user" or as "domain\user".
Windows 95 extender 11005 First showing up in WB 99G
w95GetUser will now attempt to repeatedly retry the operation for up to 30
seconds, or until a non-blank string can be returned, whichever comes first.
This is to avoid the problem where a blank string is returned when used in
a login script, and the user hasn't yet been fully logged in.
Windows 9x extender 10002 First showing up in WB 99G
New functions:
w9xGroupAdd(s:server-name, s:group-name, i:group-type, s:comment)
w9xGroupDel(s:server-name, s:group-name, i:group-type)
w9xGroupInfo(s:server-name, s:group, i:group-type, i:request)
w9xUserAdd(s:server-name)
w9xUserAddDat(s:element, s/i:value)
w9xUserDel(server-name, user-name)
w9xUserExist(s:server-name, s:user-name)
w9xUserGetDat(s:server-name, s:user-name, s:element)
w9xUserList(s:server-name, i:account-type)
w9xUserRename(s:server-name, s:old-username, s:new-username)
w9xUserSetDat(s:server-name, s:user-name, s:element, s/i:value)
Parameters and usage for all these functions are the same as in the
corresponding wnt[..] functions in the Windows NT extender, with the
restriction that "server-name" must specify an NT server (it can't be a
blank string), and "group-type" (where applicable) must be @GLOBALGROUP.
NetWare 4 extender 14024 First showing up in WB 99G
New functions:
n4FileUsers(s:server, s:filename)
Lists network users who have a file open.
"server" is the UNC name of the server on which the file is located
(eg, "\\MYSERVER").
"filename" is a full pathname to a file located on "server", in the
form "volume:path" (eg, "SYS:USER\JOHNDOE\MYFILE.TXT").
Note: This function requires console operator rights.
Returns a tab-delimited list of user names.
WB 99H Aug 17, 1999
Added new "style" to BoxDrawCircle and BoxDrawRect:
3 = transparent circle/rectangle with border.
Fixed a problem with FileMenu sometimes adding duplicate copies of the
menu items to the Explorer "File" menu.
Compiler now supports Unicode WBT files.
DLL 2.8hbt First showing up in WB 99H
In 32-bit version, fixed WinParmGet(19).
In FileVerInfo, if you specify blank strings for both "language-key" and
"resource-string", it will now return a tab-delimited list of language
keys for which version information is available in the specified file.
There was a documentation error with IntControl's 66, 67, and 68. The
"force" flag is "P2", not "P1". And with IntControl 68, the "power off"
flag is "P3", not "P2". "P1" is not currently used in any of these three
IntControl's, and should be set to 0.
IntControl(32) now allows both reading from and writing to a memory
location. The syntax has been expanded to:
IntControl (32, i:address, s:data-type, i:operation, s/i:new-value)
"operation" can be one of the following:
Value Meaning
----- -------
0 Read from memory
1 Write to memory
"new-value" specifies the value to be written to the memory location
(if "operation" == 1). It must be a single character or integer,
corresponding to "data-type".
Fixed a problem (introduced in WinBatch 99A) with OLE function calls
erroneously returning an error 1257 "Type mismatch".
In 32-bit version, fixed a problem with OLE functions adding an extra
NULL to the end of passed string parameters.
In 32-bit version, fixed a problem with KeyToggleSet sometimes not changing
the CapsLock or ScrollLock indicator lights until the next keystroke.
Fixed a problem with lines beginning with the word "to" causing a crash.
IsKeyDown and MouseInfo(4) now properly handle swapped mouse buttons.
Changed MouseInfo(4) to only look at the state of the buttons at the time
the function was called, not at the asynchronous state.
ItemCount now ignores a leading delimiter.
WaitForKey now supports the following special keycodes:
Keycode Meaning
------- -------
{INS} Insert
{NUMPAD0} 0 on numeric keypad
{NUMPAD1} 1 on numeric keypad
{NUMPAD2} 2 on numeric keypad
{NUMPAD3} 3 on numeric keypad
{NUMPAD4} 4 on numeric keypad
{NUMPAD5} 5 on numeric keypad
{NUMPAD6} 6 on numeric keypad
{NUMPAD7} 7 on numeric keypad
{NUMPAD8} 8 on numeric keypad
{NUMPAD9} 9 on numeric keypad
{NUMPAD*} * on numeric keypad
{NUMPAD+} + on numeric keypad
{NUMPAD-} - on numeric keypad
{NUMPAD.} . on numeric keypad
{NUMPAD/} / on numeric keypad
Note that NumLock must be on for the codes {NUMPAD0} through {NUMPAD9}
to be generated. Also, it cannot distinguish between the two "Enter"
keys on the keyboard (both will generate an {Enter} code).
Fixed a problem with BinaryIndex searching for high-ASCII characters.
Fixed a problem with FileVerInfo sometimes returning extraneous characters
at the end of the version string, and possibly causing a "Tag Overwrite" error.
Fixed problem running Unicode batch files and menus.
Windows NT extender 11013 First showing up in WB 99H
New functions:
wntAcctPolGet(s:server-name, i:request)
Gets account policy information for a server.
"server-name" is the UNC name of the server on which the function
will execute (eg, "\\MYSERVER"), or a blank string ("") to indicate
the current machine.
"request" specifies the information to be returned, and can be one
of the following:
Value Returns
----- -------
1 Minimum allowable password length.
2 Maximum allowable password age, in days, or -1 if passwords
never expire.
3 Minimum elapsed time, in days, between when the password was
last changed and when it can be changed again. A value of 0
indicates that no delay is required between password updates.
4 Amount of time, in seconds, between the end of the valid
logon time and the time when the user is forced to log off
the network, or -1 if users are never forced to log off.
A value of 0 indicates that users will be forced to log off
immediately when the valid logon time expires.
5 Length of password history maintained (ie, the number of
previous passwords stored in the password history buffer).
A new password cannot match any of the passwords in the buffer.
6 Lockout duration, in minutes (ie, the amount of time that a
locked account will remain locked before being automatically
unlocked).
7 Maximum time, in minutes, between any two failed logon
attempts for lockout to occur.
8 Number of invalid password authentications for which an
account is to be marked as locked out.
Note: This function can only be performed by members of the
Administrators or Account Operators local group.
Returns an integer value.
wntPrivAdd(s:server-name, s:user/group name, s:privilege)
Grants a privilege to a user or group.
"server-name" is the UNC name of the server on which the function
will execute (eg, "\\MYSERVER"), or a blank string ("") to indicate
the current machine.
"user/group name" is the name of a user or group. If necessary, it
can be fully qualified as "server\user" (or "server\group").
"privilege" is a user right which may be granted. The following is a
list of possible values (although there may be others):
"SeAssignPrimaryTokenPrivilege"
"SeAuditPrivilege"
"SeBackupPrivilege"
"SeBatchLogonRight"
"SeChangeNotifyPrivilege"
"SeCreatePagefilePrivilege"
"SeCreatePermanentPrivilege"
"SeCreateTokenPrivilege"
"SeDebugPrivilege"
"SeDenyBatchLogonRight"
"SeDenyInteractiveLogonRight"
"SeDenyNetworkLogonRight"
"SeDenyServiceLogonRight"
"SeIncreaseBasePriorityPrivilege"
"SeIncreaseQuotaPrivilege"
"SeInteractiveLogonRight"
"SeLoadDriverPrivilege"
"SeLockMemoryPrivilege"
"SeMachineAccountPrivilege"
"SeNetworkLogonRight"
"SeProfileSingleProcessPrivilege"
"SeRemoteShutdownPrivilege"
"SeRestorePrivilege"
"SeSecurityPrivilege"
"SeServiceLogonRight"
"SeShutdownPrivilege"
"SeSystemEnvironmentPrivilege"
"SeSystemProfilePrivilege"
"SeSystemtimePrivilege"
"SeTakeOwnershipPrivilege"
"SeTcbPrivilege"
"SeUnsolicitedInputPrivilege"
Returns 1.
wntPrivDel(s:server-name, s:user/group name, s:privilege)
Removes a privilege from a user or group.
See wntPrivAdd for parameter information.
Returns 1.
wntPrivGet(s:server-name, s:user/group name, s:privilege)
Determines whether a user or group holds a privilege.
See wntPrivAdd for parameter information.
Returns @TRUE if the user holds the specified privilege; @FALSE if not.
wntPrivList(s:server-name, s:user/group name)
Returns a list of priviliges granted to a user or group.
See wntPrivAdd for parameter information.
Returns a tab-delimited list of privileges.
Added new "elements" to wntUserGetDat:
Note: These elements cannot be set using wntUserAddDat or wntUserSetDat.
"password_age" (i):
Specifies the number of seconds elapsed since the password was last
changed.
"priv" (s):
One of the following values, specifying the level of privilege
assigned the user:
Value Name Meaning
----- ---- -------
0 USER_PRIV_GUEST Guest
1 USER_PRIV_USER User
2 USER_PRIV_ADMIN Administrator
"auth_flags" (i):
Specifies the user's operator privileges, based on local group
membership. This element can be any of the following values:
Value Name Meaning
----- ---- -------
1 AF_OP_PRINT The print operator privilege is enabled.
2 AF_OP_COMM The communications operator privilege is enabled.
4 AF_OP_SERVER The server operator privilege is enabled.
8 AF_OP_ACCOUNTS The accounts operator privilege is enabled.
"parms" (i):
A string that is set aside for use by applications. This can be a
string of any length, or a blank string. Microsoft products use this
element to store user configuration information.
"units_per_week" (i):
Specifies the number of equal-length time units into which the week is
divided in order to compute the length of the bit string in "logon_hours".
This value must be 168 (ie, hours per week) for LAN Manager 2.0. For
Windows NT services, this value must be 7, 168, or 10080 (days, hours,
or minutes per week, respectively).
"usri3_bad_pw_count" (i):
Specifies the number of times the user tried to log on to the account
using an incorrect password. A value of -1 indicates that the value
is unknown. This element is maintained separately on each Backup
Domain Controller (BDC) in the domain. To get an accurate value, each
BDC in the domain must be queried, and the largest value is used.
"num_logons" (i):
Specifies the number of successful times the user tried to log on to
this account. A value of -1 indicates that the value is unknown. This
element is maintained separately on each Backup Domain Controller (BDC)
in the domain. To get an accurate value, each BDC in the domain must
be queried, and the largest value is used.
"logon_server" (s):
A string that contains the name of the server to which logon requests
are sent. Server names should be preceded by two backslashes ("\\").
A server name of an asterisk ("\\*") indicates that the logon request
can be handled by any logon server. A blank string indicates that
requests are sent to the domain controller. For Windows NT Servers,
this will always return "\\*".
Added new request # to wntSvcStatus:
0 = Return @TRUE if the service exists, or @FALSE if it doesn't (other
request #'s will return an error if the service doesn't exist).
Changed wntAccessGet and wntAccessSet to open registry keys with only the
necessary access permissions, instead of all requiring all access.
Windows 95 extender 11006 First showing up in WB 99G
Windows 9x extender 10003 First showing up in WB 99H
New function:
w9xFileUsers(s:server-name, s:file-pathname)
Lists network users who have a file open.
"server-name" is the UNC name of the NT server on which the function
will execute (eg, "\\MYSERVER").
"file-pathname" is a fully-qualified file name of a file located on
"server-name" (eg, "C:\DOC\MYFILE.TXT").
NOTE: The file name MUST be fully-qualified.
Returns a tab-delimited list of user names.
NetWare 4 extender 14025 First showing up in WB 99H
New functions:
n4ObjDelete(s:context, s:object)
Deletes an NDS object.
"context" is a NetWare context, or "" for the current context.
"object" is the name of an NDS object.
Returns 1.
n4ObjRename(s:context, s:object, s:new-name, i:retain)
Renames an NDS object.
"context" is a NetWare context, or "" for the current context.
"object" is the name of an NDS object (eg, "janedoe", or
"janedoe.tech", or "cn=janedoe.o=tech").
"new-name" is the least-significant (left-most) part of the new name
to be given to "object" (eg, "janesmith").
"retain": @TRUE = retain old name as additional attribute value,
@FALSE = discard old name.
This function changes the least significant (left-most) part of a leaf
object's distinguished name. It cannot be used to move an object to a
different location in the Directory Tree, and cannot be used to rename
an object which contains subordinate objects.
Example:
n4ObjRename("", "janedoe.tech", "janesmith", @FALSE)
See also n4ObjMove.
Returns 1.
n4ObjMove(s:context, s:object, s:new-name, i:retain)
Moves an NDS object.
"context" is a NetWare context, or "" for the current context.
"object" is the name of an NDS object (eg, "janedoe", or
"janedoe.tech", or "cn=janedoe.o=tech").
"new-name" is the new name (relative to "context") to be given to
"object" (eg, "janedoe.sales", or "cn=janesmith.o=tech"). This can
be in a different location on the Directory Tree than the object's
current location (in which case the object is moved). The
least-significant (left-most) part of the new name can be the same
as the existing object's name, or it can be different (in which case
the object is renamed as well as moved).
"retain": @TRUE = retain old name as additional attribute value,
@FALSE = discard old name.
This function moves and/or renames a leaf object. It cannot be used
to move an object which contains subordinate objects.
Examples:
n4ObjMove("", "janedoe", "janedoe.sales", @FALSE)
n4ObjMove("", "janedoe.tech.newyork", "janesmith.sales.newyork", @TRUE)
See also n4ObjRename.
Returns 1.
n4ObjSearch(s:context, s:object, s:class, s:parent, i:flags)
Searches a region of the directory for an NDS object.
"context" is a NetWare context, or "" for the current context.
"object" is the name of an NDS object to search for (eg, "janedoe",
or "janedoe.tech", or "cn=janedoe.o=tech"), or "" to search for
objects with any name.
"class" identifies the type of objects to search for. It can be ""
to match objects of any class, or it can be one of the following
NetWare classes:
"AFP Server"
"Alias"
"Bindery Object"
"Bindery Queue"
"Computer"
"Country"
"Device"
"Directory Map"
"External Entity"
"Group"
"List"
"Locality"
"Message Routing Group"
"Messaging Routing Group"
"Messaging Server"
"NCP Server"
"Organization"
"Organizational Person"
"Organizational Role"
"Organizational Unit"
"Partition"
"Person"
"Print Server"
"Printer"
"Profile"
"Queue"
"Resource"
"Server"
"Top"
"Unknown"
"User"
"Volume"
Note: Standard NetWare servers have a class of "NCP Server".
"parent" identifies the starting point for the search (ie, the base
object to which the search is relative). It can be "[Root]" to
specify the DS root, or "" to specify the current context.
"flags" specifies the scope of the search. It can be one of the following:
Flag Name Meaning
---- ---- -------
0 SEARCH_ENTRY Search applies only to the base object
1 SEARCH_SUBORDINATES Search applies only to the immediate subordinates of the base object
2 SEARCH_SUBTREE Search applies to the base object and all of its subordinates
In addition, you can add one of the following option values:
Flag Meaning
---- -------
100 De-reference aliases while searching
Warning: according to Novell's documentation, "Currently, because of
aliasing, searching a subtree can result (1) in duplicate
entries or (2) in an infinite loop."
Examples:
n4ObjSearch("", "janedoe", "User", "sales", 1)
n4ObjSearch("", "janedoe", "User", "[Root]", 2)
n4ObjSearch("", "", "User", "", 102)
Returns a tab-delimited list of matching objects.
n4ObjGetVal now supports stream values, using the following method:
You must specify the address of a global memory buffer as param4, and
the size of the buffer as param5. The return value will be the number
of bytes copied to the buffer, or -1 on failure. You can specify -1 for
param4 and param5 to just return the buffer size needed.
You can obtain the address of a binary buffer using IntControl(42), and
you should call BinaryEodSet after calling n4ObjGetVal.
Fixed a problem with n4GetContext returning a non-blank string if the user
had logged into and then logged out of Directory Services befor the
function was called. It now returns a blank string in that situation.
Fixed a problem with n4UserGroups causing subsequent functions using the
context to fail.
WB99I
Shortlived release. Immediately moved onto 99J.
WB99J Aug 18, 1999
DLL 2.8jbt First showing up in WB 99J
ItemCount no longer ignores leading or trailing delimiters.
WB 99K Sept 30, 1999
New function:
MousePlay(s:X-Y-coordinates, s:parent-window, s:child-window, i:buttons, f:delay)
Performs full range of mouse associated activities.
(s) X-Y-coordinates Comma-delimited string with the final mouse
x and y position, in virtual 1000x1000 units.
(s) parent-window Name of parent window to move mouse relative
to, or "" to specify the desktop.
(s) child-window Name of child window (ie, child of "parent-window")
to move mouse relative to, or "" if the movement
will be relative to "parent".
(i) buttons Combination of one or more mouse buttons and keys
to click and/or hold down (see below for list).
(f) delay Amount of time to take for performing the mouse
activity, in seconds. Can be a decimal number
to indicate a fraction of a second. If less than 0,
must include a leading 0 (eg, 0.25).
MousePlay allows you to perform the full range of mouse associated activities
with a single function.
You can simulate drag-and-drop operations by specifying the drop location in
the "X-Y-coordinates" parameter and adding the @MPLAYLBUTTON constant to the
"buttons" parameter. This tells MousePlay to move the mouse to the position x,y
with the left mouse button down.
You can perform a mouse button click at a specific location by using one of
the button click values in the "buttons" parameter.
MousePlay can move the mouse cursor relative to the upper left-hand
corner of a window. To do this simply place a window name in the
"parent window" parameter and optionally in the "child window" parameter. If
you give MousePlay a child window name you must give it a parent name as
well. When window names are present, MousePlay considers the upper left-hand
corner of the parent or child window to be 0,0. It is, therefore, possible
to give it a negative x or y value to move the mouse cursor to the left
or above the window. If the window you specify is minimized, MousePlay will
use its last un-minimized size for calculating mouse position.
MousePlay also accepts the WIL constants @SHIFT and @CTRL in the "buttons"
parameter. You can combine these constants with a mouse button constant
using the bitwise OR ('|') operator to duplicate holding down the Shift or
Control key while performing a mouse drag-and-drop or button click.
You can use the "delay" parameter to control the amount of time MousePlay takes
to perform an action. Sometimes it is necessary to slow down the mouse so
that Windows will properly recognize the action. You may also want to slow
things down to better track events or to just give your mouse activity a natural
appearance. This parameter expects values in seconds, and only recognizes the
first three digits to the right of the decimal point.
Table of possible values for the "buttons" parameter:
(Can be combined using the bitwise | (OR) operator.)
Constant Meaning
-------- -------
@MPLAYLCLK Click left mouse button.
@MPLAYRCLK Click right mouse button.
@MPLAYMCLK Click middle mouse button.
@MPLAYLDBLCK Double click left mouse button.
@MPLAYRDBLCK Double click right mouse button.
@MPLAYMDBLCK Double click middle mouse button.
@MPLAYLBUTTON Hold down the left mouse button.
@MPLAYRBUTTON Hold down the right mouse button.
@MPLAYMBUTTON Hold down the middle mouse button.
@SHIFT Hold down the shift key.
@CTRL Hold down the control key.
Returns 1.
Example:
; Run Explorer as a maximized window
RunZoom("explorer.exe", "")
; now click on the minimize button in the upper-right corner
MousePlay("956 16", "~Exploring", "", @MPLAYLCLK, 0.423)
New IntControl:
IntControl(1008, p1, 0, 0, 0)
Enables/disables Close command.
This function sets the "allow close" flag for the WinBatch icon/window.
By default, the "Close" item on the control menu and the "Close" icon
to the right of the window title are grayed out, and WinBatch does not
respond to WM_CLOSE messages sent by applications. Using this
IntControl, you can enable all these, in which case the Close command
behaves the same as the existing Terminate/Ctrl-Break command.
P1 Meaning
-- -------
-1 Don't change (just return current setting)
0 Close command is disabled (default).
1 Close command is enabled.
Returns previous setting.
Fixed a problem with BoxButtonWait, where you could use the arrow keys to
move the focus past the last button, where the focus would get lost. A
side effect is that the arrow keys can no longer be used to move between
buttons; use the Tab key instead.
Added support for OLE functions which return a NULL type (VT_NULL). They
get returned as a blank string ("").
Dialogs displayed by AskFileName are now centered on the screen.
Fixed problem with ClipGet truncating text greater than 64K.
DLL 2.9kbu First showing up in WB 99K
New IntControl:
IntControl(71, 0, 0, 0, 0)
Dump WIL and extender function tables to the debug log file.
Debug tracing must be on for this to work (see "DebugTrace").
Returns @TRUE or @FALSE.
Added new request # to MouseInfo:
Req# Return value
---- ------------
8 returns asynchronous status of mouse buttons, as a bitmask. This
is like request #4, except #8 returns the asynchronous (current)
state of the buttons, whereas #4 returns the state at the time
the function was called.
Added new flag to AskFileName:
2 = Open Style, allowing multiple files to be selected. The selected
files will be returned as a delimited list. The combined file names
selected cannot exceed 2048 characters, otherwise an error will occur.
In the Dialog function, fixed problems related to having multiple checkboxes
with the same variable name. The values were not being initialized or
returned properly.
If debug tracing is on (via "DebugTrace"), and a 3052 error occurs
("uninitialized variable or undefined function"), the WIL and extender
function tables are automatically dumped to the debug log file.
In 32-bit version, fixed a problem trying to convert out-of-bounds
floating point numbers to strings.
In 32-bit version, fixed a problem with WinWaitExist waiting 25% longer
than the specified "timeout" value.
Fixed an OLE problem accessing properties with parameters.
Windows NT extender 11014 First showing up in WB 99K
Added new request to wntGroupInfo:
Req Returns
--- -------
-1 @TRUE if group exists, @FALSE if it doesn't.
Added new request to wntShareInfo:
Req Returns
--- -------
-1 @TRUE if share exists, @FALSE if it doesn't.
Fixed a problem with wntSvcStatus() returning various positive values,
instead of @TRUE.
Fixed a problem using the wntAudit[..] functions with registry keys.
NetWare 4 extender 14026 First showing up in WB 99K
New function:
n4SetContextG(s:context, s:tree)
Changes the current user's global default context and/or tree.
"context" is a Directory Services context to be set. If this
parameter is a blank string (""), the context will not be changed.
"tree" is a Directory Services tree to be set. If this parameter is
a blank string (""), the tree will not be changed.
This function changes the current user's default NetWare name context
and/or preferred Directory Server tree name. These changes affect
future Directory Services calls, but do not affect the current script
or other programs which are already running.
Returns 1.
The documentation for n4SetContext was a bit confusing. That function
affects only the current script, and the changes to the context and/or
tree remain in effect only for the duration of the current script.
WB 99M Oct 26, 1999
If you use BoxButtonWait and press Enter without first selecting a button,
it now sets the pressed button to be whichever button was highlighted,
instead of setting it to button #1 as before.
Fixed problem with "Terminate" menu command not working while waiting for
a button to be pressed with BoxButtonWait.
If PopMenu is unable to load one of its configured menu files (eg, because
of a syntax error), it will now display its popup menu anyway.
The compiler no longer automatically writes out a project configuration
(.CMP) file for the most-recent project on startup.
You can now specify a directory name as the first parameter to the
compiler, in which case it will let you select from a list of project
configuration (.CMP) files in that directory to be compiled in batch mode.
Note that these .CMP files must contain a "Src=" setting in the [Main]
section to identify the source file to be compiled, and this setting was
not written by earlier versions of the compiler, but can be added manually.
The source file must be located in the same directory as the .CMP file.
Fixed problem launching a 0-byte compiled script.
DLL 2.9mbu First showing up in WB 99M
New function:
BinaryReplace(i:bin-handle, s:search-string, s:replacement-string, i:match-case)
Replaces strings in a binary buffer.
"bin-handle" specifies a binary buffer.
"search-string" specifies the string to be replaced. Specify a blank
string ("") to indicate that the search string is a NULL character.
"replacement-string" specifies the string with which "search-string"
will be replaced. Specify a blank string ("") to indicate that
"search-string" should be removed and not replaced with anything.
"match-case" can be @TRUE to indicate that "search-string" is
case-sensitive, or @FALSE if case should be ignored.
This function searches a binary buffer, and replaces all occurrences
of "search-string" with "replacement-string". Each time an occurrence
of "search-string" is replaced, processing continues right after the
replacement string that was inserted in its place. If
"replacement-string" is longer than "search-string", the binary buffer
binary buffer must be large enough for all the new strings to fit.
Returns the number of occurrences of "search-string" that were replaced.
FileExist now returns @FALSE if the file name contains any '/' characters.
In 32-bit version, in BinaryWriteEx, you can now specify -1 for "count",
in which case the file size will be truncated at "file-offset" (ie,
"file-offset" will become the new file size, and any data beyond that
point in the file will be lost), and nothing will be written to the file.
Improved support for "#include" pre-processor directives in scripts
processed by programs other than WinBatch (such as PopMenu).
The "#include" pre-processor directive is no longer case-sensitive.
BinaryRead and BinaryWrite (and BinaryReadEx and BinaryWriteEx) now return
an error if they are unable to read or write the file.
MouseInfo(8) now checks the state of the buttons at the time the function
was called, as well as the asynchronous state.
Changed the algorithm used by the Random() function.
DllHwnd and DllHinst now retry the operation if the specified window isn't
found, like the other window functions do.
Fixed problem with KeyToggleGet returning an incorrect result if used in
the same script following a KeyToggleSet.
FileRead now strips out any NULL's from the file being read.
IntControl(52) now also affects the font used by the Display function.
Fixed problem with the text in a Display() window sometimes getting truncated.
Floating point numbers less than 1 are no longer required to have a leading 0.
Gosub and Goto lines containing unsubstituted %% signs no longer cause beeps.
WB 99N Nov 2, 1999
DLL 2.9mbu First showing up in WB 99N
Fixed problem with AskFileName under NT 3.51. Note that under NT 3.51, if
you specify a multiple-selection style dialog, any file or directory names
containing spaces will be displayed in the dialog as short names, but all
file names in the list returned by AskFileName will have long-form names.
Changed the syntax for IntControl(71) to:
IntControl(71, p1, p2, 0, 0)
P1 Meaning
-- -------
1 Dump WIL and extender function tables to the debug log file.
2 Set flag to dump internal debug data for every keyword lookup
(p2 = @ON or @OFF, to turn the flag on or off).
WB 99P Nov 9, 1999
DLL 2.9pbu First showing up in WB 99P
Fixed problem with a period ('.'), not preceded or followed by a number,
being treated as a floating point 0.
WB 2000A Feb 24, 2000
Fixed problem in FileMenu with FileItemize("") and DirItemize("")
sometimes returning a "function failed" error.
BoxDrawCircle and BoxDrawRect no longer draw anything if all the
coordinates are 0.
FileMenu supports new FileItemPath("") function (see below under WIL DLL).
DLL 3.0abv First showing up in WB 2000A
New functions:
FileItemPath(file-list)
Returns a delimited list of file paths.
This function is like FileItemize, but the list of file names it
returns contains full path information.
ItemReplace(item, index, list, delimiter)
Replaces an item in a list.
(s) item the replacement item.
(i) index the position in list that will be replaced by the item.
(s) list a string containing a list of items.
(s) delimiter a character to act as a delimiter between items in the list.
This function replaces an item in a list with a new item. It returns
a new list, with the specified replacement made; the original list
("list") is unchanged. For example, specifying an index of 1 causes
the first item in the list to be replaced with the new item ("item").
AskTextBox(title, prompt, default, flags, reserved)
Prompts the user for multiple lines of input.
(s) title title of the dialog box.
(s) prompt question to be put to the user.
(s) default default answer.
(i) flags see below.
(i) reserved reserved for future use, should be set to 0.
"default" can contain multiple lines of text, using embedded @CRLF's.
"flags" can be set to 0, or can specify one or more of the following
values combined with the bitwise OR ('|') operator:
Value Meaning
----- -------
1 do not automatically wrap text
2 place cursor at end of default text (instead of highlighting it)
The return value is whatever the user enters in the edit box. If
multiple lines of text are entered, they will be delimited in the
returned string with @CRLF's.
StrClean(s:source-string, s:characters, s:replacement, i:match-case, i:mode)
Removes or replaces characters in a string.
"source-string" is the string to be operated upon.
"characters" is a string specifies the characters in "source-string"
to be replaced or retained. This parameter can be a single character
(eg, "x"), a list of characters (eg, "~!@#"), or a blank string ("").
"replacement" specifies the replacement string to be inserted in
place of matching (or non-matching) characters. It can be a string,
one or more characters long. It can also be a blank string (""), in
which case matching characters are removed.
"match-case" can be @TRUE or @FALSE, indicating whether string
comparisons are case-sensitive or case-insensitive, respectively.
"mode" can be one of the following:
Value Meaning
----- -------
1 Replace all occurrences of "characters" with "replacement"
2 Replace all non-occurrences of "characters" with "replacement"
This function can be used to remove or replace specific characters in a
string, or to retain only specific characters in a string.
If "mode" is 1, then any characters which appear in "characters" will
be replaced with "replacement". If "replacement" is a blank string,
then any characters which appear in "characters" will be removed. If
"characters" is a blank string, then no chnges will be made.
If "mode" is 2, then any characters which DON'T appear in "characters"
will be replaced with "replacement". If "replacement" is a blank string,
then any characters which DON'T appear in "characters" will be removed.
If "characters" is a blank string, then ALL characters will be replaced.
The return value is the new string, with all changes made. The original
string ("source-string") is untouched.
Examples:
; Remove all spaces from a string
StrClean("Have a nice day", " ", "", @FALSE, 1)
; Replace all ampersands with the HTML code "&"
StrClean("Here & there & everywhere", "&", "&", @FALSE, 1)
; Remove all characters other then letters and spaces
StrClean("Healthy, wealthy, & wise.", "abcdefghijklmnopqrstuvwxyz ", "", @FALSE, 2)
New IntControl:
IntControl(38, p1, p2, 0, 0) (not really new, but previously undocumented)
Sets quiet mode.
P1 Meaning
-- -------
-1 Don't change (just return current setting)
0 Disable quiet mode (default).
1 Enable quiet mode.
p2 = error log filename, or a blank string ("") for no error log.
In "quiet mode":
1. No error messages are displayed. If an error log filename is
specified, then error messages will be written to that file.
2. You MUST set the "warning" parameter in any FileCopy or FileMove
commands to @FALSE, or else a fatal error will occur.
3. Sounds that would normally be controlled by the Sounds() function
are suppressed.
Returns previous setting.
"#include" directives can have leading whitespace (ie, they can be indented
with spaces or tabs). Note that an "#include" directive appearing in a menu
file MUST be indented at least 4 columns, just like all menu code must be.
DirExist no longer returns true if the directory name is followed by "*.*".
Fixed a problem with numeric strings containing an "e" incorrectly being
treated as floating point numbers.
For DebugTrace, you can now specify a mode of 2, in which case when a
terminal error occurs, the error message and the WIL variable table will
be dumped to the debug log file. This mode is entirely separate from
DebugTrace(@ON) (ie, only one of the modes can be active at any time, and
each mode has different types of output information, with no overlap).
If you use IntControl(28) to specify a fixed pitch font for list boxes,
a fixed pitch font will now also be used for ITEMBOX controls in dialogs.
IntControl(56) can now terminate an application based on its module or
file name as well as its window name. The expanded syntax is:
IntControl(56, p1, p2, 0, 0)
p1 = window or application name
p2 = name type specified by p1:
0 window name
1 module or file name (with optional path)
FileVerInfo can now return numeric version fields, by preceding the resource
string name with a '#'. The following are available:
"#FileVersion"
"#ProductVersion"
"#FileFlagsMask"
"#FileFlags"
"#FileOS"
"#FileType"
"#FileSubtype"
"#FileVersion" and "#ProductVersion" are 64-bit numbers, and are returned
as comma-separated strings in the form "n1,n2,n3,n4", where n1 is the
most significant word and n4 is the least significant word. The other
fields each return a single 32-bit number.
WaitForKey now supports punctuation keys.
Improved speed of BinaryReplace.
Fixed a problem with RegQueryMulSz crashing with NULL (blank) registry values.
BinaryStrCount now returns an error if the specified end-offset is past
the binary EOD.
Windows NT extender 11015 First showing up in WB 2000A
New functions:
wntServerInfo(s:server-name, i:request)
Returns information about a server.
"server-name" is the UNC name of a server (eg, "\\SERVER1"), or a
blank string ("") to indicate the local machine.
"request" specifies the information about "server-name" to be
returned, and can be one of the following:
1 (i) major version
2 (i) minor version
3 (i) type (see wntServiceAt for a list of server types)
4 (s) comment
5 (i) maximum users who can log on
6 (i) auto-disconnect time, in minutes, or -1 if no auto-disconnect
7 (i) hidden to other computers in domain? (0 = visible, 1 = hidden)
8 (i) network announce rate, in seconds
9 (i) delta value by which announce rate can vary, in milliseconds
10 (s) path to user directories
wntShareList(s:server-name, i:share-type, i:flags)
Returns a list of shares on a server.
"server-name" is the UNC name of a server (eg, "\\SERVER1"), or a
blank string ("") to indicate the local machine.
"share-type" is a bitmask specifying the type(s) of shares that
should be returned. It can be set to 0 to return all shares, or it
can be one or more of the following values combined with the bitwise
OR ('|') operator:
Value Share type
----- ----------
1 Disk drive
2 Print queue
4 Communication device
8 Interprocess communication (IPC)
16 Administrative or special share (eg: C$, D$, ADMIN$, IPC$)
"flags" is reserved for future use and should be set to 0.
This function returns a tab-delimited list of shared resources on a
server, including hidden shares.
Example:
wntShareList("\\SERVER", 1 | 16, 0))
wntShareUsers(s:server-name, s:share/computer-name, i:share-type, i:format, i:flags)
Returns a list of users connected to a share or server.
"server-name" is the UNC name of a server (eg, "\\SERVER1"), or a
blank string ("") to indicate the local machine.
"share/computer-name" specifies either a share name (eg, "PUBLIC")
on "server-name", or a computer name (eg, "\\FRED"). See explanation
below.
"share-type" is a bitmask specifying the type(s) of shares that
should be returned if "share/computer-name" specifies a computer name.
It can be set to 0 to return all shares, or it can be one or more of
the following values combined with the bitwise OR ('|') operator:
Value Share type
----- ----------
1 Disk drive
2 Print queue
4 Communication device
8 Interprocess communication (IPC)
16 Administrative or special share (eg: C$, D$, ADMIN$, IPC$)
"format" specifies the information that will be returned for each
connection. It can be one of the following values (see explanation
below):
Value Return format
----- -------------
1 username
2 netname
3 username|netname
"flags" is reserved for future use and should be set to 0.
This function can return either a list of users connected to a share,
or a list of computers connected to a server. If "share/computer-name"
specifies a share name, then the function will return a list of users
connected to that share. If "share/computer-name" specifies a computer
name, then the function will return a list of shares on "server-name"
(filtered by "share-type") to which that computer is connected.
This function returns a tab-delimited list of user names and/or net
names, depending on "format". The values returned are as follows:
username:
If "server-name" is running with user-level security, then
"username" will be the name of the user who made the connection.
If "server-name" is running with share-level security, then
"username" eill be the computer that made the connection.
netname:
"netname" is the opposite of "share/computer-name". In other words,
if "share/computer-name" specifies a share name, then "netname"
will be the name of the computer connected to that share, and if
"share/computer-name" specifies a computer name, then "netname"
will be the name of the share to which that computer is connected.
Example:
wntShareUsers("", "PUBLIC", 1, 1, 0)
wntRemoteTime(s:server-name, i:format)
Gets the time of day from a server.
"server-name" is the UNC name of a server (eg, "\\SERVER1"), or a
blank string ("") to indicate the local machine.
"format" specifies the format in which the time will be returned,
and can be one of the following values:
Value Format
----- ------
1 UTC/GMT time, in YYYY:MM:DD:hh:mm:ss format
2 local time (on local machine), in YYYY:MM:DD:hh:mm:ss format
wntShutdown(s:computer-name, s:message, i:timeout, i:force, i:reboot)
Shuts down (and optionally restarts) a computer.
"computer-name" is the name of an NT machine (eg, "FRED" or "\\FRED"),
or a blank string ("") to indicate the local machine.
"message" is an message to be displayed in the shutdown dialog box,
or a blank string ("") if no message is desired.
"timeout" is the amount of time, in seconds, that a shutdown dialog
box should be displayed on the specified computer before the computer
is shut down. While the dialog is displayed, a countdown timer shows
the number of seconds remaining, and when it reaches 0 the computer
is shut down. "timeout" can be set to 0, in which case no dialog is
displayed and the computer is shut down immediately.
If "force" is @TRUE, then applications with unsaved data will be
forcibly closed. If "force" is @FALSE, then the user will be
prompted to close such applications, and if the user cancels (or
doesn't respond) then the computer will not be shut down.
If "reboot" is @TRUE, the computer will be automatically restarted
after shutting down. If "reboot" is @FALSE, the system flushes all
caches to disk, clears the screen, and displays a message indicating
that it is safe to power down.
In order to shut down a remote computer, the caller must have the
privilege "Force shutdown from a remote system" (SeRemoteShutdownPrivilege).
Returns 1 on success, or an error. Note that this function returns
immediately, so the return value does not indicate whether the computer
is actually shut down or not.
wntDomainSync(s:server-name, i:request)
Synchronizes domain controllers.
"server-name" is the UNC name of the PDC (Primary Domain Controller)
or BDC (Backup Domain Controller) on which the operation will be
performed (eg, "\\SERVER"), or a blank string ("") to indicate the
local machine.
"request" specifies the operation to perform, and can be one of the
following values:
Value Meaning
----- -------
2 Force replicate on BDC (standard replication). If "server-name"
is a BDC, it will cause just that BDC to be replicated. If
"server-name" is a PDC, it will case all BDC's to be replicated.
3 Force synchronize on BDC (full replication).
"server-name" should be a BDC.
4 Force PDC to broadcast change. "server-name" should be a PDC.
5 Force to re-discover trusted domain DCs.
7 Notify netlogon that a new transport has come online.
Returns 1.
wntAcctPolSet(s:server-name, i:request, i:value)
Sets account policy information for a server.
"value" is the new value to be set for "request".
See wntAcctPolGet for additional information.
Note: This function can only be performed by members of the
Administrators or Account Operators local group.
Returns 1.
Fixed a problem with wntFilesOpen possibly crashing.
Changed the error message from "password too short" to "password is
unacceptable", unless it's clear that the password really is too short
(Windows returns a "password too short" error for various unrelated error
conditions). This affects wntChgPswd, wntUserAdd, and wntUserSetDat.
Fixed a problem with wntAcctInfo(1) returning a SID that only included the
last subauthority, instead of all of them.
Windows 95 extender 11007 First showing up in WB 2000A
New functions:
w95ServerInfo(s:server-name, i:request)
Returns information about a server.
"server-name" is the UNC name of a server (eg, "\\SERVER1"), or a
blank string ("") to indicate the local machine.
"request" specifies the information about "server-name" to be
returned, and can be one of the following:
1 (i) major version
2 (i) minor version
3 (i) type (see w95ServiceAt for a list of server types)
4 (s) comment
w95ShareList(s:server-name, i:share-type, i:flags)
Returns a list of shares on a server.
"server-name" is the UNC name of a server (eg, "\\SERVER1"), or a
blank string ("") to indicate the local machine.
"share-type" is a bitmask specifying the type(s) of shares that
should be returned. It can be set to 0 to return all shares, or it
can be one or more of the following values combined with the bitwise
OR ('|') operator:
Value Share type
----- ----------
1 Disk drive
2 Print queue
4 Communication device
8 Interprocess communication (IPC)
"flags" is reserved for future use and should be set to 0.
This function returns a tab-delimited list of shared resources on a
server, including hidden shares.
Example:
w95ShareList("\\SERVER", 1 | 2, 0))
w95ShareUsers(s:server-name, s:share/computer-name, i:share-type, i:format, i:flags)
Returns a list of users connected to a share or server.
"server-name" is the UNC name of a server (eg, "\\SERVER1"), or a
blank string ("") to indicate the local machine.
"share/computer-name" specifies either a share name (eg, "PUBLIC")
on "server-name", or a computer name (eg, "\\FRED"). See explanation
below.
"share-type" is a bitmask specifying the type(s) of shares that
should be returned if "share/computer-name" specifies a computer name.
It can be set to 0 to return all shares, or it can be one or more of
the following values combined with the bitwise OR ('|') operator:
Value Share type
----- ----------
1 Disk drive
2 Print queue
4 Communication device
8 Interprocess communication (IPC)
"format" specifies the information that will be returned for each
connection. It can be one of the following values (see explanation
below):
Value Return format
----- -------------
1 username
2 netname
3 username|netname
"flags" is reserved for future use and should be set to 0.
This function can return either a list of users connected to a share,
or a list of computers connected to a server. If "share/computer-name"
specifies a share name, then the function will return a list of users
connected to that share. If "share/computer-name" specifies a computer
name, then the function will return a list of shares on "server-name"
(filtered by "share-type") to which that computer is connected.
This function returns a tab-delimited list of user names and/or net
names, depending on "format". The values returned are as follows:
username:
If "server-name" is running with user-level security, then
"username" will be the name of the user who made the connection.
If "server-name" is running with share-level security, then
"username" eill be the computer that made the connection.
netname:
"netname" is the opposite of "share/computer-name". In other words,
if "share/computer-name" specifies a share name, then "netname"
will be the name of the computer connected to that share, and if
"share/computer-name" specifies a computer name, then "netname"
will be the name of the share to which that computer is connected.
Example:
w95ShareUsers("", "PUBLIC", 1, 1, 0)
Windows 9x extender 10004 First showing up in WB 2000A
New functions:
w9xGetDc(s:server-name, s:domain-name, i:flag)
Returns the domain controller for a domain.
"server-name" is the UNC name of the NT server on which the function
will execute (eg, "\\MYSERVER").
"domain-name" is the name of a domain, or a blank string ("") to
indicate the primary domain.
"flag" must be set to 1:
Flag Meaning
---- -------
1 Return the primary domain controller for the specified domain
Returns a domain controller name in UNC format (eg, "\\MYSERVER").
w9xRemoteTime(s:server-name, i:format)
Gets the time of day from a server.
"server-name" is the UNC name of an NT server (eg, "\\SERVER1").
"format" specifies the format in which the time will be returned,
and can be one of the following values:
Value Format
----- ------
1 UTC/GMT time, in YYYY:MM:DD:hh:mm:ss format
2 local time (on local machine), in YYYY:MM:DD:hh:mm:ss format
WB 2000B Mar 20, 2000
Compiler now sets the numeric FileVersion and ProductVersion fields to
match the corresponding string fields. The strings should be specified as
a series of up to four numeric fields, delimited by periods or commas or
spaces (eg, "3.01" or "5,1,2,0" or "2000 1 2". Any missing or non-numeric
fields will be converted to 0.
If file specified by #include directory didn't exist, it was incorrectly
returning an "unable to allocate memory" error.
DLL 3.0bbv First showing up in WB 2000B
New IntControls:
IntControl(72, p1, 0, 0, 0)
Sets Cancel handler.
This IntControl lets you specify what should happen when the next
Cancel event occurs in the script.
P1 Meaning
-- -------
-1 Don't change (just return current setting)
0 Normal cancel processing (ie, the script exits)
1 Goto the label :CANCEL
2 Gosub the label :CANCEL
By default, if you don't use this IntControl at all, then every time a
Cancel event occurs, WIL does a "Goto Cancel". The first time you use
this IntControl, the behavior changes to being a one-time flag, which
gets reset to 0 after the next Cancel event occurs.
When processing goes to :CANCEL, the following WIL variables are
automatically set:
Variable Type Meaning
-------- ---- -------
wberrorhandlerline string Cancel line (ie, line in script that caused Cancel)
wberrorhandleroffset integer offset into script of Cancel line, in bytes
wberrorhandlerassignment string variable being assigned on Cancel line, or "" if none
Note: The :CANCEL label must be in the same script where the Cancel
event occurred. If a Cancel event occurs in a called script, it will
go to the label in the called script, not the calling script.
Returns previous setting, or -1 if the setting had not previously
been changed from the default behavior.
IntControl(72, p1, 0, 0, 0)
Sets Error handler.
This IntControl lets you specify what should happen when the next
error occurs in the script.
P1 Meaning
-- -------
-1 Don't change (just return current setting)
0 Normal error processing (default)
1 Goto the label :WBERRORHANDLER
2 Gosub the label :WBERRORHANDLER
This is a one-time flag, which gets reset to 0 after the next error
occurs.
When processing goes to :WBERRORHANDLER, the following WIL variables
are automatically set:
Variable Type Meaning
-------- ---- -------
wberrorhandlerline string error line (ie, line in script that caused error)
wberrorhandleroffset integer offset into script of error line, in bytes
wberrorhandlerassignment string variable being assigned on error line, or "" if none
Note: The :WBERRORHANDLER label must be in the same script where the
error occurred. If an error occurs in a called script, it will go to
the label in the called script, not the calling script.
Returns previous setting.
Fixed a problem (introduced in WinBatch 2000A) with WaitForKey not
detecting some of the special keycodes.
In 32-bit version, if you use IntControl(49) to add system menus to dialog
boxes, the icon in the title bar will now be the application icon instead
of a generic Windows icon.
Fixed a problem with DirSize returning incorrect numbers for directories
containg files larger than 4 gigabytes.
Windows NT extender 11016 First showing up in WB 2000B
New functions:
wntSvcCreate(s:server, s:string-values, s:numeric-values, s:dependencies, s:reserved)
Adds a service to the service control manager database.
"server" is the UNC name of the server on which the function will
execute (eg, "\\MYSERVER"), or "" for the local computer.
"string-values" is a is a tab-delimited or vertical-bar ('|')
delimited list of string properties for the service being created,
in the following format:
"ServiceName | DisplayName | BinaryPathName | LoadOrderGroup | ServiceStartName | Password"
(Spaces around the delimiters are permitted, but not necessary.)
"numeric-values" is a is a tab-delimited or vertical-bar ('|')
delimited list of numeric properties for the service being created,
in the following format:
"ServiceType | StartType | ErrorControl"
(Spaces around the delimiters are permitted, but not necessary.)
"dependencies" is a tab-delimited or vertical-bar ('|') delimited
list of dependencies of the service being created. There should be
no spaces around the delimiters.
"reserved" is reserved for future use, and should be set to "".
See wntSvcCfgSet for information on the elements specifies in
"string-values" and "numeric-values".
Returns 1.
wntSvcDelete(s:server, s:service-name, i:flags)
Marks a service for deletion from the service control manager database.
"server" is the UNC name of the server on which the function will
execute (eg, "\\MYSERVER"), or "" for the local computer.
"service-name" is the name of a service.
"flags" specifies the type of name that "service-name" represents:
0 display name (the name shown in Control Panel)
1000 service name (the actual registry key name)
Returns @TRUE on success, or @FALSE if the specified service has
already been marked for deletion.
wntGroupEdit(s:server-name, s:group, i:group-type, i:request, s/i:value)
Modifies information about a group.
"server" is the UNC name of the server on which the function will
execute (eg, "\\MYSERVER"), or "" for the local computer.
"group-type" can be @LOCALGROUP or @GLOBALGROUP.
"request" specifies the element to be modified, and can be the
following:
Request Element
------- -------
1 group comment
"value" specifies the new value to be set for the element.
Note: This function can only be performed by members of the
Administrators or Account Operators local group.
Returns 1.
WB 2000C May 3, 2000
Fixed a problem with the compiler sometimes setting the "Src" key in the
project configuration (.CMP) file to the wrong source file name.
Changed BoxButtonWait to be more responsive to window messages during the
wait period.
DLL 3.0cbv First showing up in WB 2000C
New IntControl:
IntControl(74, p1, 0, 0, 0) (32-bit only)
Set idle wait after Run commands.
"p1" specifies the amount of time, in milliseconds, that the WIL
Interpreter will wait, after launching an application with the Run
(and similar) commands, for the application to become "idle" (ie,
ready for user input). The default is 10000 (ie, 10 seconds).
Specify 0 for no idle wait.
See also IntControl(43).
Returns previous setting.
Added new "function" to WinHelp (32-bit only):
"HTML" Launches HH.EXE to view a topic in an HTML help (.CHM) file.
"Keyword" specifies the topic to display, or "" to view the
starting topic in the file.
Example:
WinHelp("iexplore.chm", "HTML", "web_collect_favorites.htm")
Which is identical to:
Run("HH.EXE", "iexplore.chm::/web_collect_favorites.htm")
In AskTextBox, "default" is no longer truncated at 256 characters. Also,
a horizontal scroll bar is added if "flag" number 1 is specified. Also,
the cursor is now scrolled into view if "flag" number 2 is specified.
WinMetrics(-5) and (-6) now return floating point values (they are no
longer rounded to an integer).
Added new request to IntControl(54):
P2 Meaning
-- -------
-1 Return window's current topmost state (@TRUE = topmost, @FALSE = not)
In 32-bit version, you can now specify a negative number for TimeDelay, in
which case the negative number will be treated as a positive number (eg,
-5 will be treated as 5), and an alternate delay routine will be used.
In NT, several functions may not have worked properly after using
wntRunAsUser to impersonate a different user:
IntControl(58)
IntControl(67)
IntControl(68)
RegLoadHive
RegUnloadHive
Changed the internal routine used to create delays (eg, to wait for a
window to appear or a program to finish), so that during the delay the WIL
Interpreter is now more responsive to window messages.
Windows 32 extender 11017 First showing up in WB 2000C
Windows NT extender 11017 First showing up in WB 2000C
wntSvcCreate now prepends '.\' to the specified ServiceStartName, if it
doesn't already contain a contain a '\' (unless it's "LocalSystem"). This
matches the behavior of wntSvcCfgSet.
Windows 95 extender 11017 First showing up in WB 2000C
Windows 9x extender 11017 First showing up in WB 2000C
NetWare 3 extender 14027 First showing up in WB 2000C
NetWare 4 extender 14027 First showing up in WB 2000C
n4UserGroups now returns a blank string ("") instead of an error
if the specified user doesn't belong to any groups.
Article ID: W12712
Filename: WB98-99 Fixes and Improvements.txt