Batch Files: Examples (R)

Download the ZIPed sources Click the floppy disk or Download the ZIPed sources 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

 

 

All 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

 

Batch file 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 Version Description OS (1) Last modified Remarks
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.bat 1.00 Generate random numbers DOS 2000-07-07 Works only with comma as decimal delimiter; fixed in 2.00.
In OS/2 Rexx or KiXtart only one single line is needed to generate random numbers, Perl needs 2 lines.
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.bat 2.00 Generate random numbers DOS 2000-07-07 In OS/2 Rexx or KiXtart only one single line is needed to generate random numbers, Perl needs 2 lines.
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.bat 1.00 Generate random numbers NT 2003-08-08 Depends on US language settings.
In OS/2 Rexx or KiXtart only one single line is needed to generate random numbers, Perl needs 2 lines.
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.bat 2.00 Generate random numbers NT 2003-08-08 Language independent.
In OS/2 Rexx or KiXtart only one single line is needed to generate random numbers, Perl needs 2 lines.
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 RC.bat 2.11 Display the errorlevel returned by the specified command and the time it took NT 2012-07-02  
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.bat 1.30 Read a value from an INI file NT 2007-07-31 May fail on "special" characters like & | < > and parentheses.
In version 1.20 the speed of processing has been improved by Jeroen Verschuuren.
Version 1.30 contains several improvements by Van Woods, US Army Corps of Engineers, Seattle District.
READINI is also available as KiXtart, Perl, Rexx and and VBScript 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 ReadLine.bat 1.00 Read the specified line(s) from standard input and store it in an environment variable W2K 2011-01-19 Skips empty lines.
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.bat 2.10 Read a value from the registry NT 2004-10-25 Requires EGREP or FINDSTR.
May fail on "special" characters like & | < > and brackets.
Uses FINDSTR if available, or EGREP otherwise.
Also available as KiXtart, Perl, Rexx and VBScript 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 ReadXML.bat 1.10 Read a value from an XML file NT 2011-02-06 Requires XML Starlet
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 Recycled.bat 1.00 Create or delete a shortcut to the "Recycle Bin" in your Start Menu NT 2001-09-22 The shortcut does not give you the same functionality as the original Recycle Bin, but it can be used to quickly check the properties of deleted files.
Tested in NT 4 only.
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 RegDLL.bat 1.01 Add Explorer menu entries to register/unregister DLLs W2K 2004-01-05 Based on an article on The Code Project website
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 RemMacro 1.00 Use McAfee VirusScan to remove all macro's from MS-Office documents 95 NT 2002-03-15  
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 RemoteSID.bat 2.11 Shows who is logged on to a remote computer, displaying both user ID and Security ID (SID). NT 2001-11-15 Requires GETSID and PSLOGGEDON
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 Removables.bat 5.0c Display mounted removable devices W2K 2008-07-27 Written by Carlito S.
Does not require administrator privileges.
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 RenewUSB 1.00 Remove all USB devices and then rescan for new ones W2K 2004-06-11 Requires DEVCON.
You will be prompted for download if DEVCON 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 RestHome   Use NT's FOR /D parameter to restore a server's home directory shares and access rights NT 2000-10-17 Also available as Rexx scripts for OS/2 LAN Server; or use ForD as a FOR /D replacement in OS/2 batch 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 ResumePrinting.bat 1.00 Resume printing on the specified printer XP 2010-07-11 Requires WMIC.
Use PausePrinting.bat to pause printing.
Also available in VBScript
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 Reverse.bat 2.00 Return a string in reverse order NT 2001-08-05 See Tom Lavedas' User-to-User article for a DOS version using CHOICE.
Rexx has a built-in REVERSE() function
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 RmHidDev.bat 1.00 Remove all hidden (inactive) Plug&Play devices W2K 2006-11-10 Requires DEVCON.
Written to remove "ghost devices" from Ghost images.
You will be prompted for download if DEVCON isn't found.
Warning: May cripple your OS, use entirely at your own risk, and only after making a full backup.
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 RmUserID.bat 0.52 Delete a user account and the associated data and share W2K 2004-10-23 Requires Windows Server 2003's DS Tools, RMTSHARE, TAKEOWN, TSCMD and OWN.BAT
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 RoboMove.bat 0.20 beta Moves files in target folder to match source folder as closely as possible, to make following ROBOCOPY process more efficient W2K 2012-01-05 Best used together with ROBOCOPY.
Warning: beta version, not tested rigorously yet.
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 RunBackupWithoutSleep.bat 1.20 Run a backup, defrag or any other long task without the computer going to sleep W7 2012-10-15  
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 RxAssoc.bat 2.00 Associates the REX extension with Regina Rexx executable. After executing this batch file once, you can call any *.REX directly, without the need to precede it with REXX.EXE. NT 2000-02-11 With SET PATHEXT=.REX;%PATHEXT% (better yet: set it as a global variable in Control Panel, System) you won't need to type the .REX extension to run .REX scripts.
Adapt the (hard coded) path for REXX.EXE to your own situation.
Better still, use REGINA.EXE instead of REXX.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 RXDir.bat 0.50 Use Regular eXpressions in the DIR command NT 2004-10-16 Requires EGREP

 

All 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

 

Notes: (1) Operating System version these batch files were written for
All No version specific commands are used, though it is (obviously) not tested with every DOS version available
95 Windows 95 (and probably Windows 98 as well)
98 Windows 98
DOS3 MS-DOS 3 and 4
DOS6+ MS-DOS 6 and later
NT Windows NT 4 and later
NT4 Windows NT 4 (Windows NT 4 Terminal Server Edition too)
W2K Windows 2000 and later
XP Windows XP
W2K3 Windows Server 2003
W2K8 Windows Server 2008
WV Windows Vista
W2K8R2 Windows Server 2008 Release 2
W7 Windows 7
OS2 OS/2 Warp
TS Windows NT 4 Terminal Server Edition, or Windows Server 200* with Terminal Services

page last uploaded: 18 November 2012, 19:31