Rexx Examples

 

0..9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

 

Download the ZIPed sources Click the floppy disk icons to download the ZIPed sources

Checksums for the ZIPed sources Click the question mark icons to view the MD5 and SHA1 checksums for the ZIPed sources

 

REXX Examples
Click the floppy disk icons to dowload the ZIPed sources Click the question mark icons to view the MD5 and SHA1 checksums for the ZIPed sources Name OS Description Last Modified
(DD/MM/YYYY)
Also available in Remarks
All OS/2 Win DOS
batch
NT
batch
JScript KiXtart Perl Power
Shell
VB
Script
  Three different ways to display text:

     
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source 2Console   O   Write directly to console, preventing redirection 01/11/1999                
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source 2StdErr A     Write to standard error instead of standard output 01/11/1999              
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source RexxOut   O   A Rexx program to show and test the differences between standard output, standard error and console 01/11/1999              
 
     
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source 4AllMembers   O   Executes a command once for each member of a global group, optionaly substituting the "#" character by the user ID. 14/03/2000   NT           NT batch files available for Windows NT 4 and 2000
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source Alphabet A     Create an alphabetical navigation bar for the specified HTML file (like the one above this table).
You will have to add the <A NAME="char"> tags manually before using this script.
30/03/2005                
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source Bin2Rexx A     Converts small binary files into Rexx scripts that will, in turn, recreate the original binary file when executed. Originally created to store icon files in Rexx installation scripts. 31/12/2002                
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source BIOS.orx     W Display BIOS manufacturere & date 11/09/2006   NT   K P PS V This Object Rexx script, and the batch and PowerShell versions too, were created using my WMI Code Generator.
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source BIOSDate A     Display BIOS date 09/03/2003 D NT     P     Original idea by ComputerHope.
Perl, batch and Rexx versions all use DEBUG.EXE to read info from BIOS.
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source BIOSInfo V1 A     Display BIOS manufacturer & date 12/03/2003       K P     Perl and Rexx versions both use DEBUG.EXE to read info from BIOS.
Rexx version 1 uses "plain" string parsing, version 2 uses Patrick TJ McPhee's RexxRE Regular Expression Library.
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source BIOSInfo V2 A 02/11/2003
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source BkAllDrv     W Backup all Windows 2000 drivers 30/12/2003   NT   K P     These scripts require Microsoft's DEVCON utility; you will be prompted to download it if it isn't found
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source BkMdmDrv     W Backup Windows 2000 modem drivers 27/12/2003              
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source BkVidDrv     W Backup Windows 2000 video drivers 28/12/2003              
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source BootDriv A     Return boot drive letter 01/01/2003 D NT         V Techniques for OS/2 explained by Dick Goran in his January 1997 Rexx Column in OS/2 Magazine
  Set of three OS/2 MultiMedia Rexx scripts:

     
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source CDadd   O   Restore the audio CD player's list of CD titles and tracks 04/06/2000               This set of 3 Rexx scripts uses OS/2 MultiMedia (MMOS2) Rexx Support to perform its tasks.
This will make it extremely hard to port them to Windows.
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source CDlist   O   Save MMOS2's audio CD player's list of CD titles and tracks in ASCII format 04/06/2000              
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source CDPclean   O   Remove annoying CD player settings 04/06/2000              
 
     
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source CDEject   O   Example of OS/2 Multimedia Rexx Support
Execute it if you want a "free coffee mug holder"
04/06/2000       K   PS V OS/2 Rexx script uses OS/2 MultiMedia (MMOS2) Rexx Support.
Windows versions use Windows Media Player.
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source CDPlayer   O   Ejects CD-ROM if in CD drive at startup of CD Audio player 04/06/2000   NT           This Rexx script needs both OS/2 MultiMedia (MMOS2) Rexx Support and Quercus Systems' RexxLib to perform its task
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source CDROM A     Retrieve CD-ROM drive letter(s) 23/12/2002 D NT   K     V  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source CheckPRN     W Checks the default printer set in the registry and displays a message if it isn't an HP LaserJet III or if it isn't on your own client PC (sorry, hard coded, you'll have to adapt the "valid." variable yourself) 04/06/2000               Add this script to the logon scripts for Citrix users and save yourself lots of calls for support
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source ChkSize A     Check a file's size against a specified value 07/01/2003                
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source Choice A     Rexx version of DOS' CHOICE command 31/12/2002       K       Uses Quercus Systems' RexxLib (available for OS/2 only) for the timeout function, but will not fail if RexxLib isn't available: in that case the timeout option will just be ignored
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source CLCalc A     Command Line Calculator: retuns an errorlevel based on the result of a specified command line expression 30/12/2002                
  Convert to and from Unix style text files:

     
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source CrLf A     Replace orphaned CR and LF with CR/LF pairs 27/02/2003         P     CR = Carriage Return, LF = Line Feed
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source CrLf2Lf A     Replace CR/LF pairs with LF's only 30/12/2002         P    
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source DblCr2Cr A     Replace double CR/LF pairs with a single CR/LF pair 30/12/2002         P    
 
     
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source Cut   O W "Port" of UNIX' CUT to Rexx 04/01/2002         P     Separate OS/2 and Windows versions due to differences in handling of standard input.
Explained (a little) on my UNIX ports page
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source Dec2Hex A     Convert a decimal number to 8 digit hexadecimal 17/11/2002   NT   K P   V All
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source DefPRN   O W1
W2
Shows the default printer and port for the local computer 02/02/2003   NT J K P   V OS/2 version will even work for RPL workstations.
Windows version 1.* (W1) uses LesTec Pty Ltd.'s RexxIO library.
Windows version 2.* (W2) uses Patrick McPhee's W32Funcs library.
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source DiskUse A     Shows the amount of disk space used by subdirectories 07/01/2003   NT           Uses Quercus Systems' RexxLib if available, but will not fail if it is not.
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source DriveRdy   O   Checks if the specified drive is valid and ready 04/06/2000 D             Needs Quercus Systems' RexxLib
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source Drivers A     Batch file to display all active drivers 15/12/2003               Uses either RMVIEW and CUT (OS/2 Warp) or Microsoft's DEVCON (Windows NT4/2000/XP)
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source Easter A     Calculate Easter Day's date for a specified year 26/03/2002   NT J K P   V Based on the instructions found at Simon Kershaw's KEEPING THE FEAST.
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source False A     Port of UNIX' "false" command 02/04/2003       K P     See also the matching True command.
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source FaR A     Find and Replace substrings in a string 13/04/2003       K P     KiXtart version comes with matching FaR.bat.
  Inspired by the Norton Utilities:

     
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source FileAttr A     Display and/or set a file's attributes 31/12/2002               The Windows version of this script cannot set file attributes (only list them), the OS/2 version can. The difference is due to a difference in the RexxUtil implementations.
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source FileDate   O W Changes a file's date/time attributes 01/01/2003               OS/2 version needs Quercus Systems' RexxLib.
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source FileSize   O   Display the total file size, used disk space and slack, or disk space needed to copy 05/06/2000               Needs Quercus Systems' RexxLib.
 
     
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source FileSys A O   Check the file system of the specified drive 01/01/2002   NT           Both versions need Quercus Systems' RexxLib to function in OS/2.
  NT's FOR command ported to OS/2:

     
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source ForD   O   A first attempt to make the power of NT's FOR command, and its /D option in particular, available for OS/2 batch files 05/01/2003                
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source ForF   O   A first attempt to make the power of NT's FOR command, and its /F option in particular, available for OS/2 batch files 05/01/2003              
 
     
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source GetRes   O   Display screen resolution settings 04/06/2000   NT   K P PS V  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source GetPorts A     Display addresses of all serial and parallel ports 18/01/2003 D NT     P     Rexx, Batch and Perl versions all use DEBUG.EXE
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source HtmlTags A     Convert HTML tags to uppercase without changing scripts or quoted strings (except hexadecimal color numbers), to make the HTML file more readable and to conform to the original specifications for HTML tags 01/01/2003               By now obsolete, since the XHTML specification requires lower case tags.
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source IBMError A     Display message for specified POST error number 23/10/2002                
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source InfHdr   O   Extract the title(s) of specified OS/2 INF (help) file(s) 18/07/1999                
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source KillProg   O   Kill an OS/2 process by its program file name 12/12/2000   NT         V Needs Quercus Systems' RexxLib
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source LastBoot   O   Display the last boot time of any computer on the network 28/02/1999   XP         V XP version requires WMIC
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source LeapYear A     Check if the specified year is a leap year 26/11/2002 D NT J K P PS V MS-DOS version uses BATCHMAN by Michael Mefford
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source ListObj   O   Displays a list of all objects on your OS/2 Desktop and in its sub-folders 05/06/2000               Uses Quercus Systems' RexxLib if available, but will not fail if it is not
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source LoCase   O   Convert filenames to all lowercase 11/07/2000   NT   K       Use UpCase to convert to all uppercase
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source Obscure A     Obscure an URL by converting the host name to a decimal IP address and by adding a hostname (either vake or valid) as a fake login name 25/05/2003   NT     P     Your browser's security settings may block the use of decimal IP addresses
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source PowerOff     W Shutdown and poweroff local computer 28/10/2002               Uses W32Funcs
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source PrintPDF     W Print a list of specified PDF files 01/05/2003   NT   K P   V Uses W32Funcs
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source Random A     Display a random number between 1 and 100 14/06/2000 D NT J K P   V  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source ReadINI A     Read a value from an INI file 31/03/2003   NT   K P   V Batch version may fail on "special" characters like & | < > and brackets
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source ReadReg A     Read a value from the registry 05/04/2003   NT   K P   V Batch version may fail on "special" characters like & | < > and brackets
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source ReadLine A     Read a single line from standard input (Rexx version of OS/2 Warp COMMAND.COM's internal READLINE command) 05/06/2000                
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source Resistor   O   Using ANSI color codes to practice E12 resistor color codes 05/06/2000       K       Rexx script uses ANSI.SYS for cursor positioning; functionality included by default in OS/2; for Windows NT see George Roettger's home page for help on running ANSI.SYS in NT.
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source RxSysLvl   O   Returns OS/2 version and fix-pack level (original idea by Mike Ruskai, posted 06/24/99 in comp.lang.rexx newsgroup) 05/06/2000                
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source SCSI     W List all SCSI and IDE devices 25/10/2003   NT   K       Tested in Windows 2000 only.
View the output sample.
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source SortDate A     Display current date in YYYYMMDD format 25/03/2002 D NT J K P PS V MS-DOS version uses BATCHMAN by Michael Mefford
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source SortTime A     Display current time in HHmmss format 25/03/2002 D NT J K P   V MS-DOS version uses BATCHMAN by Michael Mefford
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source StarDate A     Convert current date & time to stardate 26/01/2003   NT   K P   V Based on an algorithm found on The StarTrek Gallery
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source TaskList   O   Display a list of active programs 06/06/2000   NT       PS V Needs Quercus Systems' RexxLib
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source Tee A     Port of UNIX' TEE command: redirect standard input to standard output and to a file simultaneously. 15/02/2003   NT     P     Explained (a little) on my UNIX ports page
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source Tomorrow A     Display tomorrow's date in 2 formats. 29/12/2002     J K P PS V  
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source True A     Port of UNIX' "true" command 02/04/2003       K P     See also the matching False command
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source TxtComp A     Compare two text files (ignoring locations of lines) and write the differences into two newly created log files.
Multilingual (NL and US, other languages can be added easily).
02/03/2003           PS   Originally created to compare OS/2 CONFIG.SYS files before and after a software installation, this program will prove extremely useful when comparing other ASCII files as well.
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source Unique A     Remove duplicate lines from a text file 06/12/2003               Written to check and modify small text files only; although it does work with large files, it will be really slow!
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source UpCase   O   Convert filenames to all uppercase 11/07/2000   NT   K       Use LoCase to convert to all lowercase
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source VideoROM A     Display manufacturer info from the display adapter video ROM 25/12/2002 D NT   K P   V Original idea by ComputerHope.
Rexx, Batch and Perl versions use DEBUG.EXE.
VBScript and KiXtart versions created using Microsoft's Scriptomatic tool.
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source WallPaper   O W Randomly change bitmaps for background (Windows and OS/2) and lockup screen (OS/2 only) 16/06/2004   NT         V Read the comments in the script before using it
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source Week A     Display week number. 21/08/2001 D NT J K P PS V DOS batch version needs Solid Oak Software's WEEKOFYR.COM.
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source Which   O W Enhanced "port" of UNIX' WHICH to Rexx 04/06/2000 D NT   K P PS   Explained (a little) on my UNIX ports page
Click the floppy disk icon to dowload the ZIPed source   WMIGen.hta       This HTA generates Batch, C#, F#, JScript, KiXtart, Object Rexx, Perl, PowerShell, Python, Ruby, VB .NET and VBScript code for WMI queries 19/05/2011             HTA Automatically checks for updates.
Based on the example from the Microsoft TechNet ScriptCenter article Scripting Eye for the GUI Guy, with help from the Scripting Guys' Scriptomatic 2.0 and HTA Helpomatic tools and The Script Center Script Repository: Sample Windows PowerShell Scripts.
C# code generation with assistance of Bas van der Woude.
Click the floppy disk icon to dowload the ZIPed source Click the question mark icon to view the MD5 and SHA1 checksums for the ZIPed source Yesterday A     Display yesterday's date in YYYYMMDD format. 26/03/2002   NT J K P PS V  

 

0..9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

 

 

 


page last uploaded: 19 May 2011, 22:25