Jump to content

Batch file


Recommended Posts

Posted

Can anybody tell me

is there any book for writing Batch file for Windows XP professional or How

to start it

  • Replies 2
  • Created
  • Last Reply

Popular Days

Guest Paul Randall
Posted

Re: Batch file

 

 

"SANG" <SANG@discussions.microsoft.com> wrote in message

news:5E249B7A-EC3D-43A9-A29C-3D5BF7B5E498@microsoft.com...

> Can anybody tell me

> is there any book for writing Batch file for Windows XP professional or

> How

> to start it

 

There are old books available, but I don't know of any books that include

the batch features recently added to this facility.

 

Here is a very simple example:

Create a folder in which to do some testing.

In that folder, create a text file and rename it dir.bat

The .bat extension can be used for Batch files.

Right click on the dir.bat file and choose edit. This should open the file

in Notepad.

copy the two following lines and paste them into Notepad:

dir *.* >dir.txt

dir *.*

In Notepad, save the file.

When executed, a command line window is opened. This window is typically

black. The first line gathers the directory information and send it to a

file named dir.txt. The second line displays the directory in a command

line window. When done, the command line window closes. Because this all

happens very quickly, the command line window may only flash on the screen

for a fraction of a second.

 

To test the batch file:

Double click file dir.bat

 

You will know that the batch file executed properly by checking the folder.

Besides the original file named dir.bat, you should also see a file named

dir.txt.

 

To see a list of many things you can do in batch files:

Open Help & Support through the start button.

Paste the following line into the help & support window's search box:

command line reference a-z

Hit enter. One of the items found should be Command-line reference a-z.

Click it.

Scroll down to the B section and click on Batch Files

Enjoy.

 

For more info, use google, searching for the following three things,

including the quote " marks:

tutorial example "batch file"

 

-Paul Randall


×
×
  • Create New...