Batch Files: Examples (L)

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 LastBoot.bat 1.01 Display the last boot time of any WMI enabled computer XP 2010-02-10 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 LastFile.bat 1.00 Reopen most recently used file from the Documents folder NT 2001-10-20  
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 LastWUpd.bat 1.00 Return date and time of the last successful Windows Update XP 2009-09-11  
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 LDIF2vCard.bat 0.11 alfa Very basic LDIF to vCard converter XP 2013-11-28 Fails on unescaped ampersands.
May require some manual editing after conversion: e-mail addresses and phone numbers should always be preceded with either WORK: or HOME: or PREF: and sometimes these prefixes are swapped or left out.
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.bat 2.00 Check if the current year is a leap year or not DOS 2002-12-16 Requires BATCHMAN.
Also available as JScript, KiXtart, Perl, PowerShell, 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 LeapYear.bat 1.01 Check if the specified year is a leap year or not NT 2002-10-05 Uses code to extract current year by Simon Sheppard.
Also available as JScript, KiXtart, Perl, PowerShell, 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 ListADComputers.bat 1.00 List computer objects in Active Directory XP 2013-10-20 Requires DSQUERY
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 ListDHCP.bat 1.00 List the DHCP server for every network adapter XP 2010-07-25 Uses NETSH
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 ListHDDs.bat 1.11 List all physical harddisk models on a remote PC W2K 2009-12-02 Requires WMIC or DEVCON.
If neither WMIC nor DEVCON is available, you will be prompted to open the DEVCON download 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 ListFilesBetween.bat 1.02 List matching files with timestamps between 2 specified dates NT 2011-11-12  
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 ListICA.bat 1.00 List all IP addresses associated with Citrix' ICA round robin alias in DNS NT 2004-10-25  
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 ListPRN.cmd 2.01 List specified (NT) or all (NT and OS/2) network printers' UNC path NT OS2 2000-06-05 Bonus C# source and compiled EXE included with ZIPed sources
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 ListSDKs.bat 1.00 List installed Microsoft SDKs, or display the version number for a specified SDK XP 2008-05-30 Requires REG 3.0. 
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 ListWMIClasses.bat 1.01 List (a tiny fraction of the) available WMI classes in the "root\CIMV2" namespace XP 2010-09-29 Requires WMIC.
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 LoCase.bat 3.00 Convert filenames to all lowercase NT OS2 2001-11-20 New LoCase.bat uses a trick by Niels Stout; it is much faster, but can be used in the current directory only; the old version is still available in case you need to rename files in other directories.
Also available as KiXtart and OS/2 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 LockProg   How to lock single user programs when in use on a network All 1999-07-13  
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 LogBatch.bat 1.00 Log every individual command line of a batch file W2K 2007-11-07  
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 LogHist.bat 1.11 Read URLs from IE history and write them to a file named %UserName%.hst NT 2003-10-20  
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 LstOffVw.bat 1.00 List all Office Viewers and their version numbers W2K 2008-05-17 Also available in VBScript.
This batch file uses FILEVER.EXE and is about 10 times as fast as the WMI/VBScript version.

 

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