Batch file programming tutorials

Multi-Threaded Robocopy by First-Level Subfolder

contributed by Ben Kendall on May 2, 2011 under Batch file programming, Microsoft Windows 7

Robocopy is a wonderful tool for synchronizing directories, migrating servers, or just generally copying data on or between Windows systems. The built-in version of Robocopy on Windows 7/Server 2008 R2 introduced a multi-threaded copy option; however, this is not available in earlier editions of Windows. Read on to discover how to do multi-threaded Robocopy operations with a batch file with any version of Windows.

 

Windows 7: Mounting and Unmouting WIMs Using a DISM Batch File Menu

contributed by Jimmy Selix on January 19, 2011 under Batch file programming, Microsoft Windows 7, Windows installation

This tech-recipe will include a batch file that lets you mount and unmount .WIM files in Windows 7 Professional / Ultimate and Windows Server 2008. I will also explain some the basics of WIM files and discuss how to manage them using DISM from the command prompt.

 

How to run your own PowerShell scripts / cmdlets

contributed by Ben Kendall on December 3, 2010 under Batch file programming, Microsoft Windows 7

By default, Microsoft has prevented the running of custom PowerShell scripts, a.k.a. cmdlets, by setting the PowerShell “ExecutionPolicy” to “Restricted”. This can be changed easily.

 

7-Zip: How to list contents of a folder and subfolder of zip files without extracting (Win XP,Vista,7 and Command Line)

contributed by Jimmy Selix on November 3, 2010 under Batch file programming

This tech-recipe will explain how to use 7-Zip to create a text file (tab delimited) listing of the contents of a zip file.  You can run this .bat file in a directory and get the listings of every ZIP file contained in that directory and any sub-directories.  Keep reading for the commands and explanation.

 

Batch File: How to retrieve Asset Tag / Serial Number for a Dell computer

contributed by Jimmy Selix on October 4, 2010 under Batch file programming

This guide is a quickie on how you can use a batch file to retrieve asset tag and / or serial number information for a Dell desktop or laptop.  This recipe assumes that the Dell computer has had its asset tag entered into the BIOS. Note, not all computer motherboards use this field in WMIC but Dell computers will.

 

Batch File Scripting: How to export, find and replace, and reimport a registry key (XP, Win2k3, Vista, Windows 7)

contributed by Jimmy Selix on March 31, 2010 under Batch file programming

This recipe is designed for the more operating system savvy persons and for those who work in an app deployment corporate setting.  Many times when you work in IT and in an app deployment team you run into situations where you need to either find a registry key and find a key and replace with a new entry.  However, sometimes there are cases where you know the main registry entry key but are not sure which entries below it may need to be changed.   Lets find a solution!

 

Windows XP/Vista: Use a Batch File for Quickly Restarting explorer.exe

contributed by Rob Rogers on February 22, 2008 under Batch file programming

Explorer.exe is the user shell on your Windows system (taskbar, desktop, etc.) and periodically it requires a restart to resume proper functionality. Additionally, if you do a lot of tweaking to your system registry like I do, it’s much easier to restart explorer.exe to reload the registry instead of restarting the entire system. By creating a .bat file, you will have a quick 2 step solution that will restart explorer.exe and get you back to computing in just a few seconds.

 

XCOPY command : Using the /EXCLUDE flag

contributed by Jimmy Selix on November 7, 2007 under Batch file programming

This recipe will briefly explain how to use the /EXCLUDE flag with XCOPY. This can be very handy if you need to backup a full directory but do not need or want specific file types or folder or file names.