Batch Files: Examples

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

 

 

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
(yyyy-mm-dd)
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 Wait   Wait for a specified number of seconds All 2000-06-04 Requires SLEEP (NT) or RexxUtil's SysSleep function (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 Wallpapr 1.00 Randomly change bitmaps for background screen W2K 2004-08-21 Read the comments in the script before using it.
Also available as OS/2 Rexx, Windows Rexx and VBScript scripts.
Use SetWallp.bat or Wallpaper.vbs if you want to specify the bitmap yourself.
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 WANIP.bat 4.00 Display your WAN connection's IP address and host name NT 2009-01-29 Requires WGET.
Idea: Gregg Dotoli.
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 Week.bat   Display week number. DOS 2001-10-07 Requires WEEKOFYR.
Also available as Kix, Rexx, Perl or VBScript script.
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.bat 1.00 Display week number. NT 2001-10-07 Also available as Kix, Rexx, Perl or VBScript script.
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.bat 1.00 A Unix-like WHICH utility DOS 1999-05-30 Available for NT and OS/2 (Rexx) and as KiXtart and Perl 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 Which.bat 4.02 A Unix-like WHICH utility NT 2008-12-20 Available for DOS and OS/2 (Rexx) and as KiXtart and Perl 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 WhoAmI.bat   Show info on workstation and current user NT 2000-06-12 Also available for OS/2 as WhoAmI.cmd
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 WhoHasIt.bat 1.00 Show info on remote workstation and current user W2K 2004-10-21 Requires Windows Server 2003's DS Tools
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 WhoIs.bat 2.00 Display WHOIS database entry for the specified domain. All 2002-10-12 Also available as VBScript script
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 WhoIsIt.bat 1.00 Show specified domain user's display name W2K 2004-10-21 Requires Windows Server 2003's DS Tools
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 WhoRU.bat 3.11 Remote WhoAmI (Who Are You) NT 2000-10-15 Requires GETMAC, GETSID, SRVINFO and WINSDMP
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 Win3264.bat 1.00 Check if Windows is a 32 or 64-bits version NT 2009-12-27  
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 WinUpd.bat 1.00 Reenable Windows' Update feature 95 NT 2002-04-10 Also available as KiXtart script.
Click the floppy disk icon to dowload the ZIPed source   WMIGen.hta 5.00 This HTA generates Batch, C#, JScript, KiXtart, Object Rexx, Perl, PowerShell, Python, Ruby, VB .NET and VBScript code for WMI queries NT 2010-06-30 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 WUTest.bat   Checks time of last Windows Update install against time of last download, and reports a failure if the last download was later XP 2009-09-14  

 

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
Kix Windows (most functions also in plain DOS) with KiXtart
NT4 Windows NT 4 (Windows NT 4 Terminal Server Edition too)
NT Windows NT (Windows 2000 and Windows NT 4 Terminal Server Edition too)
W2K Windows 2000, and probably XP and Server 2003 as well
W2K3 Windows Server 2003
XP Windows XP
OS2 OS/2 Warp
TS Windows NT 4 Terminal Server Edition, or Windows 2000 Server or Windows Server 2003 with Terminal Services
QR Code for http://www.robvanderwoude.com/batexamples.php?fc=W

unique visitors since July 2007

page last uploaded: 2 September 2010, 18:50