Rob van der Woude's Scripting Pages

Batch Files: Examples (S)

💾 Click the floppy disk or package (for third party scripts) 📦 icons to download the ZIPped sources

Click the question mark icons to view the MD5 and SHA1 checksums for the ZIPped 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
💾 Name Version Description OS (1) Last modified Remarks
💾 Scheduld.bat 1.00 List all scheduled task and their main properties W2K 2003-11-19 Requires STRINGS
💾 SCList.bat   List the properties of all shortcuts on an NT machine NT 1999-10-01 Requires SHORTCUT
💾 Screen.bat   Demo: different ways to display text NT 1999-11-03 Also available as OS/2 Rexx script.
💾 ScrnRes.bat 1.02 Change remote PC's screen resolution NT 2004-08-25 Requires PSEXEC and Resolution Changer
💾 ScrnSavr.bat   Install a Windows screensaver and open Control Panel's screensaver settings page 95 98 NT 1999-10-23  
💾 ScrSzDOS.bat 1.00 Save current screen size (lines and columns) in environment variables DOS 2002-03-17  
💾 ScrSzNT.bat 1.00 Save current screen size (lines and columns) in environment variables NT 2002-03-17  
💾 SCSI.bat 1.10 Enumerate disk drives (IDE and SCSI) NT 2006-09-11 Requires EGREP.
Also available in KiXtart and Rexx.
💾 SCSI.bat 2.10 Enumerate disk drives (IDE and SCSI) W2K 2006-09-11 Also available in KiXtart and Rexx.
💾 SecondChoice.bat 1.00 Present a list of choices, and wait for the user to either pick a choice by number or to press Enter for the default choice. XP 2016-03-03  
💾 SecLogin.bat 1.00 Make Windows XP's logon more secure by using the "classic" login dialog instead of the welcome screen, disabling the display of the last user name at logon, and requiring Ctrl+Alt+Del to logon. XP 2009-08-19 See the Related Stuff section for a note on "Force Ctrl+Alt+DEL" and "Don't display last user name" in Vista and Windows 7.
💾 SecStat.bat 2.20 Display a SecurityCenter status overview XP 2010-01-18 Requires Windows XP Professional SP2 or SP3.
Use WBEMTEST.EXE to find all properties for a specific AntiVirus or Firewall product.
Also available in KiXtart and VBScript.
💾 Servers.bat 2.02 Display size, free space and used space (both in MB and as a percentage of disk size) for every partition on every server. NT 2001-05-24 Requires SRVINFO.
Also available in Rexx and VBScript as FreeSpace.*.
💾 SetOwn.bat 1.00 Restore ownership and permissions for roaming (TS) profile directories. W2K3 2005-07-02 Requires CHOWN, TSCMD, XCACLS and NLTEST.
You will be prompted for download if any of the required (third party) tools is not available.
💾 SetWallp.bat 1.00 Make the specified file Windows' wallpaper W2K 2007-01-30 Use Wallpapr.bat to use a random bitmap as wallpaper.
💾 SHA1.bat   Calculate the SHA1 checksum for the specified string NT 2010-07-15 Requires PHP
💾 ShareMig.bat 1.00 Migrate all non-printer shares from one server to another. W2K 2005-11-02 Must be run on the server, fails on share names containing spaces, but is "universal" for both Windows 2000 and Windows Server 2003.
For printer migration, read the Printing section of my Unattended Installations page, for Scheduled Tasks migration, read the Scheduled Tasks section.
💾 ShareMg2.bat 2.00 Migrate all non-printer shares from one server to another. W2K 2005-11-02 Requires ShareMg2.vbs 2.00.
Requires manual modifications for Windows 2000, but it can be run from any computer in the domain and it won't fail on share names containing spaces.
For printer migration, read the Printing section of my Unattended Installations page, for Scheduled Tasks migration, read the Scheduled Tasks section.
💾 ShDsktop.bat 1.00 Restore the Show Desktop shortcut in the Quick Launch tray W2K 2003-06-10  
💾 Shortcut.bat 2.10 List the (UNC and fully qualified) path that shortcuts point to NT 2005-07-11 Use SCList.bat if you need all properties, not just the path (requires the NT Resource Kit).
💾 ShortExt.bat 1.00 Display or modify "extension truncation" registry setting NT 2002-03-02 Based on a tip from the Windows Registry Guide.
💾 ShowPRN.bat 1.00 Display all physical printers W2K 2004-01-17 Requires DEVCON.
Also available as VBScript script.
💾 ShowPRNT.bat 1.00 Display all physical printers in tab delimited format W2K 2004-01-17 Requires DEVCON.
Also available as VBScript script.
📦 Shuffle.bat 1.00 Shuffle the order of the lines in a text file NT 2011-03-14 Written by Jiri Hofreiter.
💾 SID2User.bat 1.00 Return the SID for the specified user ID XP 2010-07-26 Requires WMIC.
Also available in VBScript.
💾 SimpleSitemap.bat 1.10 Create a basic sitemap.org compliant sitemap W2K 2010-09-03 Much faster than Sitemap.bat, but limited to (all) PHP and HTM(L) files in a single folder.
💾 Sine.bat   Calculate the sine for the specified angle in radians NT 2010-07-15 Requires PHP
💾 SineDeg.bat   Calculate the sine for the specified angle in degrees NT 2010-07-15 Requires PHP
💾 Sitemap.bat 1.00 Create a basic sitemap.org compliant sitemap W2K 2009-02-17 Slower than SimpleSitemap.bat, but supports exclude list and multiple folders and filespecs.
📦 Snake.bat 1.00 ANSI demo for Windows 10 W10 2018-06-04 Written by Robert Van Etta
💾 SNDisk4.bat 1.00 Save a full computer inventory in XML format NT 2010-12-27 Requires IBM's EGatherer2 2.51
💾 SortDate.bat 5.01 Store "sorted" date (YYYYMMDD) in a variable, independent of Control Panel's "Regional Settings" All 2010-07-10 Take a look at DateTime for a "real DOS" version.
Much simpler in KiXtart, Perl, Rexx or VBScript.
💾 SortTime.bat 3.40 Store "sorted" time (HHmm) in a variable, independent of Control Panel's "Regional Settings" All 2010-07-10 Take a look at DateTime for a "real DOS" version.
Much simpler in KiXtart, Perl, Rexx or VBScript.
💾 Spider.bat   Display the validity of hyperlinks in a group of locally stored HTML files NT 2005-11-12 Requires WGET and CUT
💾 SrvSpace.bat 1.12 Display free space for every partition on every server. TAB delimited screen output for easy export of output. NT 2000-06-05 For Windows XP use DiskSpc.bat instead.
💾 StarDate.bat 1.00 Convert current date and time to stardate NT 2003-01-26 Based on an algorithm found on The Star Trek Gallery.
Also available as KiXtart, Perl, Rexx and VBScript scripts.
💾 StarDateXP.bat 2.00 Convert current date and time to stardate XP 2011-06-21 Requires WMIC.
Based on an algorithm found on The Star Trek Gallery.
Also available as KiXtart, Perl, Rexx and VBScript scripts.
💾 StartHow.bat 1.00 Display the actual command issued when a file is opened with the START command NT 2010-07-06 Some programs (e.g. UltraEdit) may override the shown file association.
💾 SwitchRes.bat 1.00 Toggle a Netbook's screen resolution from 1024x600 to 1024x768 vv. W7 2012-11-12 Requires SetRes and WMIC
💾 SysBkup.bat   Run a SystemState Backup W2K 2007-02-10 Requires NTBackup

 

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
W10 Windows 10
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 modified: 2024-04-20; loaded in 0.0334 seconds