Batch files - Examples (C*)

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

 

Batch file examples
Download the ZIPped sources Name Description OS (1) Last modified
(DD/MM/YYYY)
Remarks
Download the ZIPped sources Capture.bat Append a screen capture to a multi-page TIF file W2K 27/06/2008 Requires IrfanView.
Download the ZIPped sources Catalog.bat (DOS) Create a (HTML) catalog of your Webshots collections DOS6+ 21/01/2001 Works with old webshots collections (before November 2001) only!
The DOS version has screen output only.
This site is in no way affiliated with Webshots!
Catalog.bat (NT) NT 21/01/2001
Download the ZIPped sources CDACTXP.bat Show a list of all CD/DVD drives containing a disk XP 26/11/2005 Uses XP's DISKPART to determine the CD/DVD-ROM drive letters. May fail if any disk volume is labeled "CDFS".
Download the ZIPped sources CDPlayer.bat Play audio CD's or just some tracks NT 04/08/2001 Also available as OS/2 Rexx script
Download the ZIPped sources CDROM.bat Determine which drive letter is assigned to the CD-ROM drive 95 98 NT 25/12/2001 Also available as Kix, Rexx and VBScript scripts.
Download the ZIPped sources CDROMXP.bat Determine which drive letter is assigned to the CD/DVD-ROM drive XP 21/11/2005 Uses XP's DISKPART to determine the (last) CD/DVD-ROM drive letter. May fail if any disk volume label ends with "-ROM".
Download the ZIPped sources CheckCon.bat Check if you are connected to the internet 95 98 13/07/1999  
Download the ZIPped sources CheckDST.bat Lists active computers that don't have automatic DST adjustment enabled. NT 28/07/2005  
Download the ZIPped sources ChkNAV.bat List all viruses found on all servers by Norton Antivirus NT+RK 14/07/2001 You will need to modify this batch file to make it work with current versions of Symantec AntiVirus
Download the ZIPped sources ChkPath.bat Verify if all PATH entries are valid directories W2K 17/07/2008 This batch file may work in Windows NT 4 too, but I didn't check
Download the ZIPped sources ChkSize.bat Check if the actual file size matches a specified minimum size NT OS2 23/09/2000 Also available as Rexx script
Download the ZIPped sources Chomp.bat Remove trailing carriage return/line feed from strings NT 12/10/2001 Loosely based on Perl's CHOMP command
Download the ZIPped sources CkBkSchd.bat Display status of all Scheduled Tasks with "backup" in their names W2K 26/06/2008 Requires JT from the Resource Kit and will prompt you to download it if not found
Download the ZIPped sources CLLUN.bat Clear Last Logon User Name: clears the last user name from the login dialog box once, or replaces it with a different name. 95 98 NT 13/08/2002 Use DDLU.bat instead if you never want the last logon user name displayed again
Download the ZIPped sources CloneDate.bat Apply the first file's timestamp to the second file specified W2K 28/07/2005 The batch file uses my own FileDate.rex and the Regina Rexx interpreter to change the second file's timestamp.
Also available in VBScript, as a single "self contained" script.
Download the ZIPped sources CloneUsr.bat Create a new domain user account by cloning an existing account W2K 18/08/2005 Requires Windows Server 2003's DS Tools & SystemTools.com's TSCmd
Download the ZIPped sources CnvrtUrl.bat Convert IE Favourites to Netscape Bookmarks 95 NT 29/04/2001  
Download the ZIPped sources CompName.bat
CompName.kix
Change the computer name 95+Kix 12/10/2003 The batch file is actually a "wrapper" for the KiXtart script. Requires KiXtart
Download the ZIPped sources Country.bat Read the Country setting from NT's registry NT+RK
W2K
11/02/2001 Uses REG.EXE (NT 4 Resource Kit, or native in Windows 2000 and later) and no temporary files
Country3.bat NT 19/05/2001 Uses temporary files, but doesn't need the Resource Kit
Download the ZIPped sources CurDrive.bat
CurDriv1.bat
Determine the current drive and place it in environment variable DOS6+ 06/05/2000 CurDriv1.bat uses Laurence Soucy's "CHOICE technique" first demonstrated in BootDrv*

 

 

Notes: (1) Operating System version these batch files were meant 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)
NT+RK Windows NT with Resource Kit (Windows NT 4 Terminal Server Edition with Resource Kit too)
W2K Windows 2000, and probably XP and Server 2003 as well
W2K+RK Windows 2000 with (Server) Resource Kit, 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