Discussion Locked

paul

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
blog root

1 reply

by paul

Before we start on making batch files to install our applications and registry tweaks, you may want to find out what they do and to see how they are used:

Batch files (*.cmd or *.bat, although *.cmd is recommended) can be executed in several areas of Windows XP's Setup process. Using batch files helps to automate several tasks at once without any interaction required.

They can be executed from either cmdlines.txt, svcpack.inf, a RunOnceEx entry in the Registry, or from the [GuiRunOnce] section in winnt.sif. You will learn more about these as you go through this issue.

Typical contents of a batch file


Batch files supports all the commands that work as if you were using the Command Prompt. To see Windows XP's Command Prompt, go to Start > Run > and type cmd followed by enter.

Let's try making a small batch file that does several things. Open Notepad and copy and paste the following:

@echo off
title Batch File Testing
 
echo Hello World
 
echo.
echo Starting MS Paint
start mspaint
 
echo.
echo Starting Wordpad
start Wordpad
 
echo.
pause
exit



Save this as anything you like, as long as it has a .cmd extension. Now double-click on the file. You will find that it renames the Window title to "Batch File Testing", opens MSPaint and Wordpad, asks you to press any key to continue, and then it exits.

 

 

This discussion is closed to new replies.