Batch files - Examples (D*)

 

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

 

Click the diskette icon to dowload the ZIPped source Click the floppy disk icons to download the ZIPped sources

 

Batch file examples
Click the diskette icon to dowload the ZIPped source Name Description OS (1) Last modified
(DD/MM/YYYY)
Remarks
Click the diskette icon to dowload the ZIPped source DateAdd Add/subtract a specified number of days to/from a specified date NT 12/02/2007 Based on Fliegel-Van Flandern Julian date conversion algorithms from the Astronomical Almanac, provided by Doctor Fenton on the Math Forum and converted to batch code by Ron Bakowski
Click the diskette icon to dowload the ZIPped source DateDiff Calculate the difference in days between two dates NT 04/06/2007 Based on Fliegel-Van Flandern Julian date conversion algorithms from the Astronomical Almanac, provided by Doctor Fenton on the Math Forum and converted to batch code by Ron Bakowski
Click the diskette icon to dowload the ZIPped source DateFmt Show the current date in the specified format NT 07/08/2008 Inspired by Simon Sheppard's GetDate.bat
Click the diskette icon to dowload the ZIPped source DatePart Return the specified numerical part of the current date or time NT 15/11/2008 Batch "wrapper" for VBScript's DatePart( ) function
Click the diskette icon to dowload the ZIPped source DateTime Store week day, current date and current time in environment variables All   Take a look at SortDate and SortTime for an NT version with language independent sorting, or at DateErrT for a version that uses ErrTime by Phil Money to remain virtually OS independent
Click the diskette icon to dowload the ZIPped source DateTime.cmd Return the current date as errorlevel in YYYYMMDD format XP 27/04/2009 Written by Justin.
Tested only in Windows XP.
Requires modifications to work on non-English systems.
Click the diskette icon to dowload the ZIPped source DDLU.bat Don't Display Last Username: clears the last user name from the login dialog box permanently. NT 20/12/2001 Use CLLUN.bat instead to remove the last logon user name just this once.
See the Related Stuff section for a note on "Don't Display Last Username" in Vista and Windows 7.
Click the diskette icon to dowload the ZIPped source DeadProf.bat Delete inactive corrupted profiles for current user NT 15/09/2000  
Click the diskette icon to dowload the ZIPped source Dec2Hex.bat Convert a decimal number to 8 digit hexadecimal NT 08/12/2007 This batch file uses a "poorly documented" feature of the PING command to convert a decimal number to hexadecimal.
Requires FINDSTR (not native in NT 4, but part of the Resource Kit).
Also available in KiXtart, Perl, Rexx and VBScript.
Click the diskette icon to dowload the ZIPped source DecToHex.bat Convert a decimal number to "7.5" digit hexadecimal NT 08/12/2007 This batch file uses CMD.EXE's internal commands only.
Also available in KiXtart, Perl, Rexx and VBScript.
Click the diskette icon to dowload the ZIPped source DefOpen.bat Create a default file association to Notepad and add "Open with Notepad", "Print with Notepad" and "Command Prompt Here" options to popup menus 95 98 NT 2000 XP 21/11/2007 Based on a tip by Regedit.com.
More details on my REGEDIT page.
Click the diskette icon to dowload the ZIPped source DefPRN.bat Display default printer name NT 07/11/1999 Also available as OS/2 Rexx, Windows Rexx, JScript, KiXtart, Perl and VBScript scripts
DefPRN2K.bat W2K 13/02/2002
Click the diskette icon to dowload the ZIPped source DelFlash.bat Delete "Local Stored Objects", also known as "Flash Cookies", from the current user's profile NT 15/09/2007 Tested on Windows XP SP2 only. Use entirely at your own risk!
Also available in VBScript.
Click the diskette icon to dowload the ZIPped source DelOutlX.bat Uninstall Outlook Express (BETA!) W2K 20/12/2003 Tested on 1 Windows 2000 computer only.
Use entirely at your own risk!
Click the diskette icon to dowload the ZIPped source DelProf.bat Delete specified profile (BETA!) NT 17/12/2003 Still in beta! That is why the most destructive command of the batch file is echoed only.
Click the diskette icon to dowload the ZIPped source Desktop.bat Uses SHORTCUT.EXE to save all desktop shortcuts as a batch file that can recreate those shortcuts again (Desktop backup) NT+RK 05/08/2001  
Click the diskette icon to dowload the ZIPped source Disabled.bat Lists all disabled user accounts NT 21/09/2000  
  DiskFree Check amount of free disk space, the hard way All   Use FreeSpace.vbs if you need a more reliable tool
Click the diskette icon to dowload the ZIPped source DiskSpc Display harddisk summary for any WMI enabled computer or for a list of computers XP 02/10/2006 Uses WMIC
Click the diskette icon to dowload the ZIPped source DiskUse.bat List the disk usage for every subdirectory NT 20/12/2003 Returns negative numbers if total file sizes exceed 2GB.
Also available as Rexx script
DiskUse.bat W2K 21/12/2003 Fixed negative numbers bug for Windows 2000/XP
Click the diskette icon to dowload the ZIPped source DispEDID.bat Display your monitor's EDID asset information XP 20/02/2007 Also available in VBScript
Click the diskette icon to dowload the ZIPped source DllMenu.bat Add "Register" and "Unregister" to Explorer's context menu for DLLs & OCXs W2K 18/04/2007  
Click the diskette icon to dowload the ZIPped source DriveRdy.bat Check if (removable) drive is ready DOS6+ OS2 18/07/1999 Also available as OS/2 Rexx script
Click the diskette icon to dowload the ZIPped source Drives.bat List local drive letters and types W2K 17/12/2003  
Click the diskette icon to dowload the ZIPped source DrivUsed.bat List used and available drive letters XP 30/12/2007  

 

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 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

visitors can't be wrong...

page last uploaded: 13 September 2009, 16:26