

  Copyright  1995, 2001       Don Beusee Software                     Page 1 

   
                                WINX32 Version 5.0 
   
  WINX32 is Freeware for personal, non-commercial use.   You may freely 
  distribute WINX32, as long as all files from the archive are included.  WINX32 
  requires no runtime libraries, since it was written in Borland's Delphi32! 
   
                           ***** LIMITED WARRANTY ***** 
   
  THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS WITHOUT WARRANTY OF ANY KIND, 
  EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF 
  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO 
  QUALITY AND PERFORMANCE OF THESE PROGRAMS IS WITH YOU.  SHOULD THE PROGRAM 
  PROVE DEFECTIVE, YOU (NOT DON'S SOFTWARE) ASSUME THE ENTIRE COST OF ALL 
  NECESSARY REPAIR, SERVICING, OR CORRECTION.  IN NO EVENT WILL DON'S SOFTWARE 
  BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING ANY LOST PROFITS, LOST SAVINGS, OR 
  OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY 
  TO USE THESE PROGRAMS, EVEN IF DON'S SOFTWARE HAS BEEN ADVISED OF THE 
  POSSIBILITY OF SUCH DAMAGES. THIS WARRANTY GIVES YOU SPECIFIC LEGAL RIGHTS, 
  AND YOU MAY ALSO HAVE OTHER RIGHTS, WHICH VARY FROM PROVINCE TO PROVINCE OR 
  STATE TO STATE. SOME STATES DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES 
  OR EXCLUSION OF LIABILITY FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES SO THE ABOVE 
  MAY NOT APPLY TO YOU.   YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT, 
  UNDERSTAND IT, AND AGREE TO BE BOUND BY ITS TERMS AND CONDITIONS. YOU FURTHER 
  AGREE THAT IT IS THE COMPLETE AND EXCLUSIVE STATEMENT OF THE AGREEMENT BETWEEN 
  US, WHICH SUPERSEDES ANY PROPOSAL OR PRIOR AGREEMENT, ORAL OR WRITTEN, AND ANY 
  OTHER COMMUNICATIONS BETWEEN US. 
   
   
                                   INSTALLATION 
   
  Just run INSTALL.BAT to install winx32 (you can double-click it from the 
  windows explorer).  Winx32.exe will be installed into the windows directory 
  then winx32 will be associated with .wx files. 
   
   
                                    DESCRIPTION 
   
  WINX32 lets you run several window programs as one icon or shortcut.  It will 
  either wait for a program to finish or not (your choice!).  It will execute 
  programs starting with the command line arguments.  "@file.ext" tells WINX32 
  to  read and execute commands from file.ext.  These can be nested, as long as 
  any of the files called do not result in the original file getting called 
  again.  You also have the choice of starting a specified program maximized, 
  minimized, or hidden. 
   
   
                                      TO USE 
   
  Using WINX32 is pretty easy.  All you need to do is create a .wx file that 
  contains the commands you want to execute and put it on the desktop or in the 
  Start menu anywhere you like. 

  Copyright  1995, 2001       Don Beusee Software                     Page 2 

  For instance, to create a shortcut on the desktop, just right-click on the 
  desktop and select New then Text Document.  Now name it anything you like and 
  make sure it ends with .wx and click Yes to change the extension.  Now right-
  click on it and Edit it to put the commands that you want to execute when you 
  double-click this file.  Once you have done this, you can execute the file by 
  simply double-clicking on the .wx file you created. 
   
  Options that can be given right after the program name (before space and its 
  arguments) are: 

  Option              Description 
  ------------        ------------------------------------------------ 
  /h[ide]             start program hidden. 
  /i[gnore]           ignores any error. 
  /max                start program maximized. 
  /min                start program minimized. 
  /noactivate         start  program  minimized,  don't  change  focus  to  new 
                      window. 
  /w[ait]             waits for program to terminate before continuing. 
  /warn               warns if error, but continue. 
   
  Note:   brackets indicate optional full spelling of options (e.g. /h and 
           /hide are the same). 
  Example: notepad/w/max starts notepad maximized and waits for it to exit. 
   
  There are also internal winx32 commands, which are specified on a separate 
  line: 
  Command             Description 
  ---------------     -------------------------------------------------------- 
  @<file>             Execute winx32 commands from file. 
  /activate <window>  Activate window by title. Examples: Microsoft Word*, 
                      *Notepad 
  /do {cmdblk} [/while <ifexpr>] 
                      Execute commands in cmdblk without raising errors at the 
                      script level (the /do command stops running commands when 
                      an error is encountered, but the script is not aborted 
                      and errorlevel() is set to 1 if a winx32 error occurred 
                      (such as an error trying to start a program)).  This 
                      allows /if errorlevel() (or /set e=errorlevel()) to be 
                      used right afterwards to check if the commands in the 
                      command block worked or not. 
                      Note that you should do a /waitall as the last command in 
                      the  cmdblk  if  you  use  errorlevel()in  the  /while 
                      expression and you want errorlevel() to consider the exit 
                      status of all the programs you started without /wait.  
                      Otherwise,  it  will  only  consider  that  the  programs 
                      started successfully (which is perfectly valid if thats 
                      what you want). 
                      If you use /ignore on any commands, those commands dont 
                      have to start successfully and errorlevel() will be 0 for 
                      such programs or commands. 
                      If the /while clause is not specified, the behavior is 
                      the same as if /while 0 was specified (cmdblk executes 
                      once).  The /while clause is evaluated after cmdblk is 
                      executed. 
  /cd <directory>     Change to <directory> to run all following commands in. 
  /close <window>     Close  window  by  title.    Examples:  Microsoft  Word*, 
                      *Notepad 
  /if <ifexpr> {cmdblk} [/else {cmdblk}] 

  Copyright  1995, 2001       Don Beusee Software                     Page 3 

                      if <ifexpr> is true, {cmdblk} is executed.  Otherwise the 
                      /else  {cmdblk}  is  executed.    See  /if  command 
                      expressions section below for valid expressions. 
  /kill <program>     Kill process by program name (including extension).  No 
                      error  will  occur  if  there  is  no  process  with  the 
                      specified name.  Any and all processes running matching 
                      the program name will be killed.  Examples: notepad.exe, 
                      notepad* 
  /pause <message>    Display <message> with an OK button to continue before 
                      starting next command. 
  /plist              List programs running in a pop-up window (helps figure 
                      out what arg to give to /kill). 
  /sendkeys <keys>    Send keystrokes to the active window (see below). 
  /set debug=<on|off> if on, winx32 will only show what it would do, without 
                      executing any commands.  This is good to check syntax of 
                      .wx files (note that the WinX Command Editor doesnt 
                      allow invalid syntax to be added). 
  /set waitinternval=<milliseconds> 
                      /waitfor and /waitclose will wait <milliseconds> between 
                      intervals.  The default is half a second (500).  This 
                      setting prevents winx32 from being CPU intensive on an NT 
                      server, especially if you have a lot of winx32 processes 
                      looking for different windows to pop-up. 
  /set <variable>=<value>  Set an environment variable to the specified value. 
  /sleep <seconds>    Sleep for <seconds> seconds before starting next command. 
  /waitall            Wait for all started commands to finish (those that were 
                      started without /wait).  A maximum of 50 commands will be 
                      waited on.  The commands to wait on must have been 
                      started by this instance of winx32 (i.e. from the same 
                      shortcut).  Errorlevel() will report the value of the 
                      last program that returned a non-zero exit code. 
  /waitfor <window>   Wait for a window to appear. 
  /waitclose <window> Wait for a window to close. 
  /wlist              List windows running on the system in a pop-up window 
                      (helps figure out what arg to give to commands that take 
                      a <window> argument). 
   
  <program> and <window> can contain '*' pattern matching at the beginning and 
  end of the strings only.  <program> is case-insensitive.  <window> is case 
  sensitive. <file> is a filename (preferably a full pathname, but it can be a 
  simple filename).  All of these are evaluated as a <strexpr>.  <strexpr> is a 
  string expression (see String Expressions section below).  <cmdblk> is a 
  block of commands.  Each command in the block must be on a separate line. 
   
  /ignore and /warn can be used with internal commands. 
   
  There are also comment characters (which must be the first printable 
  character on the line).  A # or ; character represents a comment line. 
   
  String Expressions (<strexpr>): 
   
  All command arguments are considered to be string expressions, which are 
  evaluated.  The following functions are expanded to their string return 
  values: 
   
  env(var)       Returns value of environment variable.  E.g. env(Path) 
  errorlevel()   Returns errorlevel of last O/S command or /do block. 
   
  You can do some operations on string expressions also: 

  Copyright  1995, 2001       Don Beusee Software                     Page 4 

  strexpr & strexpr        concatenate 2 string expressions together 
  strexpr + strexpr        add 2 string expressions (must result to numbers) 
  strexpr - strexpr        subtract 2 string expressions (must result to 
  numbers) 
   
  Strings inside double-quotes are not evaluated.  If you need a string 
  expression (to be evaluated by winx32) which is only part of the argument, 
  you need to use the concatenation operator (&).  If you need to use string 
  expressions in old (pre-5.0) commands, you must double-quote the first arg to 
  force new argument parsing on old commands.  This is necessary for 
  compatibility reasons. 
   
  /If and /while expressions (<ifexpr>): 
   
  The /if command accepts the following expressions: 
   
  <strexp1> EQ <strexp2>   True if string expressions match. 
  <strexp1> NE <strexp2>   True if string expressions dont match. 
  <strexp1> GT <strexp2>   True if string expression 1 is greater than string 
  expression 2 (evaluated as ascii strings). 
  <strexp1> LT <strexp2>   True if string expression 1 is less than string 
  expression 2 (evaluated as ascii strings). 
  0              Always false 
  1              Always true 
   
  Example: 
   
  /set file=C:\autoexec.bat 
  /do { 
     notepad env(file) 
  } 
  /if errorlevel() NE 0 { 
     /pause "errorlevel = " & errorlevel() & ", X=" & env(x) 
  } 
  /else { 
     /pause it worked 
  } 

  Copyright  1995, 2001       Don Beusee Software                     Page 5 

   
  SendKeys: 
   
  Each key is represented by one or more characters. To specify a single 
  keyboard character, use the character itself. For example, to represent the 
  letter A, use "A" for string. To represent more than one character, append 
  each additional character to the one preceding it. To represent the letters 
  A, B, and C, use "ABC" for string. 
   
  The plus sign (+), caret (^), percent sign (%), tilde (~), and parentheses ( 
  ) have special meanings to SendKeys. To specify one of these characters, 
  enclose it within braces ({}). For example, to specify the plus sign, use 
  {+}. Brackets ([ ]) have no special meaning to SendKeys, but you must enclose 
  them in braces. In other applications, brackets do have a special meaning 
  that may be significant when dynamic data exchange (DDE) occurs. To specify 
  brace characters, use {{} and {}}. 
   
  To specify characters that aren't displayed when you press a key, such as 
  ENTER or TAB, and keys that represent actions rather than characters, use the 
  codes shown below: 
   
  Key                      Code 
  ----------------         ----------------------------- 
  BACKSPACE                {BACKSPACE}, {BS}, or {BKSP} 
  BREAK                    {BREAK}        **NOT SUPPORTED 
  CAPS LOCK                {CAPSLOCK}     **NOT SUPPORTED 
  DEL or DELETE            {DELETE} or {DEL} 
  DOWN ARROW               {DOWN} 
  END                      {END} 
  ENTER                    {ENTER} or ~ 
  ESC                      {ESC} 
  HELP                     {HELP}         **NOT SUPPORTED 
  HOME                     {HOME} 
  INS or INSERT            {INSERT} or {INS} 
  LEFT ARROW               {LEFT} 
  NUM LOCK                 {NUMLOCK}      **NOT SUPPORTED 
  PAGE DOWN                {PGDN} 
  PAGE UP                  {PGUP} 
  PRINT SCREEN             {PRTSC}        **NOT SUPPORTED 
  RIGHT ARROW              {RIGHT} 
  SCROLL LOCK              {SCROLLLOCK}   **NOT SUPPORTED 
  TAB                      {TAB} 
  UP ARROW                 {UP} 
  F1                       {F1} 
  F2                       {F2} 
  F3                       {F3} 
  F4                       {F4} 
  F5                       {F5} 
  F6                       {F6} 
  F7                       {F7} 
  F8                       {F8} 
  F9                       {F9} 
  F10                      {F10} 
  F11                      {F11} 
  F12                      {F12} 
  F13                      {F13} 
  F14                      {F14}          **NOT SUPPORTED 
  F15                      {F15}          **NOT SUPPORTED 
  F16                      {F16}          **NOT SUPPORTED 

  Copyright  1995, 2001       Don Beusee Software                     Page 6 

   
  To specify keys combined with any combination of the SHIFT, CTRL, and ALT 
  keys, precede the key code with one or more of the following codes: 
   
  Key                      Code 
  ----------------         ----------------------------- 
  SHIFT                    {SHIFT}  or + 
  CTRL                     {CTRL}   or ^ 
  ALT                      {ALT}    or % 
   
  To specify that any combination of SHIFT, CTRL, and ALT should be held down 
  while several other keys are pressed, enclose the code for those keys in 
  parentheses. For example, to specify to hold down SHIFT while E and C are 
  pressed, use "+(EC)". To specify to hold down SHIFT while E is pressed, 
  followed by C without SHIFT, use "+EC".  To specify repeating keys, use the 
  form {key number}. You must put a space between key and number. For example, 
  {LEFT 42} means press the LEFT ARROW key 42 times; {h 10} means press H 10 
  times. 
   
  Note: You can't use SendKeys to send keystrokes to an application that is not 
  designed to run in Microsoft Windows. Sendkeys also can't send the PRINT 
  SCREEN key {PRTSC} to any application. 
   
   
  Example .wx file: 
     command.exe/wait 
     # Start Notepad to open autoexec.bat then sleep for 5 seconds 
     notepad c:\autoexec.bat 
     /sleep 5 
     ; Start Word to print mydoc.doc and wait for it to finish 
     "c:\program files\microsoft office\office\winword"/wait /p c:\mydoc.doc 
     excel 
     ; tell notepad to exit 
     /activate *Notepad 
     /sendkeys {ALT}fx 
     /sleep 1 
     ; kill any/all excel processes (no chance to save work) 
     /kill *excel* 
     /waitall 
     /pause all programs finished -
                                  - press OK to start Netscape 
     netscape 
   
  The above will start a dos prompt and wait for it to finish, then start 
  notepad, winword, wait for word to finish, and then start excel and wait for 
  notepad and excel to finish, then start netscape. 
   
  Note: normally the last line in the .wx file shouldn't have the /wait option, 
  since this causes winx32 to stick around for no reason. 
   

  Copyright  1995, 2001       Don Beusee Software                     Page 7 

   
  WinX Editor: 
     The editor has some hidden tricks: 
     - Right click on a command will bring up the edit menu choices. 
     - Double-click on a command to edit it. 
     - You can select multiple commands to be moved or deleted using the mouse 
        with shift or ctrl. 
     - Press the Delete key to delete selected command(s). 
     - Press the Insert key to add a command. 
     - Press the Enter key to edit the selected command(s). 
     - Use up/down arrow keys to change selection (with shift to select 
        multiple) 
     - Pressing Enter in dialog boxes acts like the OK button was pressed. 
     - Pressing Esc in dialog boxes acts like the Cancel button was pressed. 
   
  If you have any questions or suggestions regarding WINX32 you can send E-Mail 
  to the author at dbeusee@yahoo.com 

   
  Please be sure to put WINX32 and the version number in the subject field. 

  Send me a note if you use the program so I can inform you via email of new 
  versions, and so that I know it is being used, which would motivate me to 
  make enhancements. 

  The latest version of this program can be found at the following URL: 
     http://www.simtel.net/simtel.net/win95/util 
  (look for a file beginning with "WINX32"). 

  Or use google to search to get directly to it: 
     http://www.google.com/search?hl=en&q=winx32+simtel 
  (click on the first entry, which should begin with www.simtel.net.  If you 
  dont find it, change +simtel to +zip in the above URL). 
   

  If you like the program and you feel like sending me a donation (as a reward 
  for my hard work) or a postcard, please email me for my current address. 

  Keep in mind any check should be cashable at a bank in the U.S. without a 
  fee. 

  List of files in the archive: 
  FILE_ID.DIZ     For BBS use 
  INSTALL.BAT     Installs winx32 
  WINX32.TXT      This README file 
  WINX32.EXE      WINX32 executable file 
  WINX32.REG      Registers association of .wx to winx32 (install.bat calls 
                  this). 
  PSAPI.DLL       Process functions for Windows NT (for /kill and /plist 
  commands). 

  Copyright  1995, 2001       Don Beusee Software                     Page 8 

  Version History: 

  1.1  Added /min, /max, and /hide options. 
  1.2  Fixed bug where an extra line was required at the end of all files read 
       by WINX32.  Also Fixed FILE_ID.DIZ to 45 chars wide. 
  1.3  Added ability to associate .WX extension with WINX32 so you can simply 
       put the .WX file in an icon or shortcut and have WINX32 execute it.  A 
       /cd command was also added to allow programs to be started in different 
       directories. 
  1.4  Added new syntax for command line to support Windows 95 long filenames.  
       Curly braces delimit each command and double-quotes delimit words.   
       This allows long filenames to be passed with spaces, like this: 
       {notepad "C:\Program Files\Common Files\Microsoft Shared\Dao\Dao.cnt"} 
  1.5  Give Message Box when executing WINX32.EXE with no argument(s).  Gives 
       hints on what to do.  /sleep <seconds> and /pause <message> commands 
       added.  WINX32.TXT (this file) brought up to date on syntax and my 
       address. 
  1.6  Fixed problem with 32-bit version where you could not execute a .wx file 
       that was already being executed.  Also fixed the /sleep command. 
  1.7  Fixed problem where winx32 could not run shortcuts or other non-
       executable  files  directly.    Simplify  documentation  by  removing 
       documentation of old (still supported) cryptic usage, since it was 
       confusing.  Supply install.bat to install winx32 and automatically 
       associate .wx files with winx32.  Also fixed problem with 'winx32 "file 
       with spaces.wx"' (handling of double-quotes) which failed with the 
       default  association.    Fixed  documentation  (/hide  should  be  /h).  
       /waitall command added. 
  1.8  Added /ignore and /warn options.  Added full spelling for some options 
       (e.g. /hide).  Syntax errors are never ignored and now will cause winx32 
       to terminate after displaying an appropriate error message. 
   
  2.0  Added a WinX Editor for WinX files, which is built into the WINX32 
       executable.  Just right-click on a .wx file and choose WinxEdit to 
       invoke this editor.  Or invoke the winx32.exe executable to invoke the 
       editor.  Editor has a right-click menu which is the same as the Edit 
       menu, which is how you create new commands, edit existing ones, or 
       delete existing ones. 
  2.1  Fixed install.bat script (wx.reg -> winx32.reg).  Fixed hangs while 
       winx32 is waiting for a program to finish (winx did not respond to 
       windows during the wait operation).  Allow right-click on winx32 icon to 
       close winx.  If closing winx32 from task manager, winx will now respond 
       to the request and terminate. 
  2.2  Winx32 no longer goes into tight loops when waiting for commands to 
       finish (users would notice their system was responding slower when winx 
       scripts were running). Some WinX Editor tricks are documented above.  
       WinX Editor enhancements: 1) The editor is now aware of internal 
       commands, and if one is selected, the label for the "Command Arguments" 
       field is changed to reflect what argument is expected (e.g. "Seconds to 
       sleep" for /sleep).  2) You can now select multiple lines and delete or 
       move them around.  3) Added a Replace All function in the Edit menu in 
       the WinX editor to replace all occurrences of a string to easily change 
       all lines containing the same text. 
  2.3  /noactivate added so WinX32 can start programs without the window focus 
       changing.  Fixed typo in name of WinX32 Editor window.  Fixed problems 

  Copyright  1995, 2001       Don Beusee Software                     Page 9 

       with the editor with @ command (read commands from file) and # and ; 
       (comment lines). 
   
  3.0  Added program control capabilities: /plist to list processes running (by 
       program name), /kill to kill a process by program name, /close to close 
       a window, /activate to activate a window, /sendkeys to send keystrokes 
       to active window.  Fixed a problem with INSTALL.BAT on Windows NT.  
       Implemented a new ICON provided by a user of WinX32, (thanks Bryan!). 
   
  4.0  Added /waitfor to wait for a window to appear, /waitclose to wait for 
       window to disappear.  Added Help/About to editor.  Editor now has 
       filename in titlebar instead of a separate field.  Can now run a .wx 
       file from the editor (File/Run) and titlebar reflects running status.  
       Allow double-quotes with internal command arguments.  /ignore and /warn 
       apply to internal commands also.  Add error handling to /activate, 
       /close, /kill (if window/program not found, give an error (unless 
       /ignore) and abort (unless /warn or /ignore)).  Added /wlist command to 
       see  a  window  list  (useful  for  figuring  out  /activate  or  /close 
       argument).  Fixed /sendkeys - %(string) and {KEY(s) repeat} didn't work 
       as documented. 
  4.1  Fixed bugs with double-quotes in .wx files causing WinX32 to not 
       recognize it's command options. 
  4.2  Added find capability to /plist and /wlist commands to search for named 
       windows or executables (* is automatically inserted before and after 
       string  to  perform  a  wildcard  search).    Changed  title  of  Winx32 
       application when a .wx file is running.  This allows you to /close or 
       /kill another .wx script. 
  5.0  The command parser is completely re-written.  Syntax of winx32 command 
       line arguments (not using a .wx file) is now {command args}{command 
       args} (the braces are optional if only one command is specified).  The 
       very old command,arg command,arg syntax is no longer supported (e.g. 
       winx32 {/sleep 5}{notepad \autoexec.bat} must be used instead of winx32 
       /sleep,5 notepad,\autoexec.bat.  For .wx files, Pre-5.0 commands allow 
       the same syntax, except if they have double-quotes, in which case the 
       new syntax is required - which means the ending quote must terminate the 
       argument, otherwise anything after that quote is treated as another 
       argument. Newer commands (commands new in 5.0 and above) have more 
       strict syntax - keywords and some special characters are interpreted 
       unless the string is contained within double-quotes.  This allows the 
       newer commands to have more than one argument, such as the new /if 
       command.  A .wx file being executed is checked completely for syntax 
       errors before running any of the commands in it.  If there are syntax 
       errors, no commands are executed.  Note that this doesnt apply to 
       string expressions, because the syntax of string expressions is not 
       checked until actually executed (since the value is not evaluated until 
       that point).  The new parser allows any number of spaces anywhere (also, 
       commands dont have to start at column one, as before -
                                                              - this allows you 
       to indent commands inside /do and /if blocks).  Added /set, /if .. 
       /else, /do .. /while commands.  Introduced string expression functions: 
       env(var), errorlevel(). 