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