Batch file programming tutorials

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

Contributed by shamanstears 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.

Comments
 

XCOPY command : Using the /EXCLUDE flag

Contributed by seamonkey420 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.

Comments
 

Batch Files : Get users default printer via registry (WinXP)

Contributed by seamonkey420 on August 18, 2007 under Batch file programming

This is another quickie recipe for you admins. This recipe shows how to get the current user’s default printer via the registry and output the information to a text file via a batch file and in turn combine the result files into a larger file to then import into excel.

Comments
 

XP Batch Files: Copy images from camera to pc and organize by date

Contributed by seamonkey420 on December 25, 2006 under Batch file programming

This is a quickie recipe on how to create a batch file that will copy all of your photos/videos from a memory stick or camera onto your pc’s my pictures folder (c:\documents and settings\userid\my documents\my pictures). this batch file will show you how to setup a prompt and using a basic if/then statement.

Comments
 

XP batch files: Create variable for current user account and find current user

Contributed by seamonkey420 on December 7, 2006 under Batch file programming

this is a quick batch file recipe that is more of an appetizer than a full meal. this recipe is just a quick batch file that lets you find the user who is currently logged in when the batch file is ran by using a FOR statement and the %USERPROFILE% variable in XP.

Comments
 

Batch File Converting of Video Files: SageTV example

Contributed by seamonkey420 on April 8, 2006 under Batch file programming

Well, i used to run SageTV as my PVR frontend but have later decided to switch to MCE2005 due to its cleanness and integration into XP. Anywho, in that time i found a For statement batch file i used to create my own script to autoencode video. After playing with For statements so long, i realized that it could be used for so much more!!

Comments
 

Date Calculation In Batch Files XP/2000

Contributed by dtech10 on November 21, 2005 under Batch file programming

Comments
 

Using variables in Windows batch files

Contributed by Rex on August 29, 2004 under Batch file programming

Regardless of the scripting language, the use of variables can greatly enhance the functionality of a script. This recipe demonstrated basic use of variables in MS-DOS or Windows batch files.

Comments