home
faq
how to
sitemap
contact
 
How to create a simple script file in winXP.
 
 
May 15 , 2011
 
   
page 1
 
 

Here we describe how to create a simple script file in winXP, that is, we are creating a file that will run commands at the command line prompt of winXP.

First we just create a file that will become the script. This can be done in various ways, or simply open a file manager to create a new file. The file manager in winXP is called windows explorer. This can be found via the taskbar button:

     Start  -->  Programs  --> Accessories  --> Windows Explorer

From there we can navigate to the directory of choice to create the script files. For this example let us make the test directory:

     D:\temp_scripts\

Once there, we can right click in the directory and create a text file with an extension of bat, like the following:

     test_script.bat

Right-click on this file to open it in a text editor of choice, like notepad, or we like Editpad.

Once inside the editor add some test commands like echo:

     echo OFF
     echo hello world
     echo good morning starshine

Save the file, and open a dos box (the command line prompt). This can found via the desktop start button:

     Start  -->  Programs  --> Accessories  --> Command Prompt

Then navigate to the directory that holds the test script file, by typing in at the command line:

     > d:
     > cd temp_scripts
     > dir

(Don't type the ">" character)
(The "d:" command will switch to a different hard drive other than the "c:" drive. If you created your directory in the "c:" drive, then you won't need to type the "d:" command.)
(The "cd" command stands for change directory.)

The dir command should list the contents of the current directory, and within that list we should see the file that we just created:

     test_script.bat

Finally, to test the script file we just run it at the command line by typing the name of the script file at the command line:

     > test_script.bat

This should produce the following at the command line:

     > echo OFF
     hello world

     good morning starshine

A list of other commands, besides echo, can be found in many locations on the net.

 

appendum:

 

line continuation, add this at the end of line to continue:    ^

 

page 1

 

dark maelstrom icon dark maelstrom
flash games
  t-shirt icon dark maelstrom
t-shirt designs

  purple bitcoin icon 1Ap7vxXJTvy5jL2B1f4sgC9ivq6Tb57Xyu  

 

back

home