Top Bar
Half Price Computer Books

Search and Save
Visit Half Price Computer Books
Fusion 13 Home Fusion 13
Computing Fusion 13 Alcohol
Recovery Link to Fusion 13 W

Search Fusion13.com Computing
PicoSearch
Find what you were looking for?
Drop us a note.      


This DOS Information page is now young, but will grow to be a Reference Center that we can all use!! Please help out by sending suggestions on DOS topics (including optimization of code and new or little known tips and tricks).

Also, I can't ALWAYS answer all questions, but if you do have any pertaining to DOS or DOS batch scripting, please email and let me know! Anything helpful (questions or suggestions) will be posted to this website, along with a credit to you (with your permission).

computing@Fusion13.com



--------------------------------------------------------------------------------

The 13th Ocean defines Batch Files as multiple DOS commands placed together in a file which executes the DOS commands in succession.

To create a batch file:

To start, let's look at the basics of just creating a text file with the extension .bat itself. I would begin by opening notepad. After starting your new file, go to File > Save (some versions of Windows insist that you type text into your new notepad document before saving it??!!), and choose the location where you would like to save your file to... DON'T HIT SAVE YET!!! Here comes the important part:

Instead of leaving the default 'Save As Type:' as '.txt', pick 'All Files' from the dropdown box. Then save your new batch file to the filename of your choice, but DO NOT forget to specify that your file will have the '.bat' file extension.

See screenshot below.

Screen shot of renaming a text file to save as a batch file.

Please email me with any questions about the above process. The computer shown is running Windows 2000, so your screen may differ slightly from the one pictured above.

One of the most basic and functional batch files to create is one that transfers data from one place to another (very useful when automating a data transfer, or creating a backup script). The following batch script (written in text) will copy the data from C:/Data.txt to A:/DataBackup.txt. This is something that you can use if you regularly create data (such as passwords that change, account info that will change, or anything that changes on a regular basis). Remember, that unless you set the permissions on the newly created file (covered in later submissions) that the new file will be readable (and writable) by all others. If this is a concern, place the floppy disk in secure location.




@echo off
REM Do not allow non-echoed commands to be written to the screen (displayed)
REM Anything written into a batch file after REM (on that particular line) is considered a comment
REM and will not be executed at run time. Several remarks are made here to help explain this file.

REM *****************************************************************************

REM Start Batch File

REM *****************************************************************************

REM Use "echo." to create a blank line (for cosmetic reasons)
echo.
echo.


REM For the next line to work, there must be a file present named C:\Data.txt.
echo This will create the file A:\DataBackup.txt from C:\Data.txt
echo.
echo Press Ctrl+C to stop, or... REM Pressing Ctrl+C will interrupt the execution of a batch file
pause


echo.
copy C:\Data.txt A:\DataBackup.txt
echo.
echo Data has been transferred to A:\dataBackup.txt
echo.
pause


REM *****************************************************************************

REM End Batch File

REM *****************************************************************************




Linux Information



Half Price Computer Books


Did you find this document to be helpful? Have any questions? Send us a note: computing@Fusion13.com
Broken links? Typographical errors? Send to: webmaster@Fusion13.com

Fusion 13 has taken painstaking effort to ensure the validity of its data;
however, the information contained in this document is provided without warranty.
The data presented is offered simply as a suggestion.
Fusion 13 can in no way be held responsible for how these suggestions are implemented in any environment.

Vote for Fusion13.com

Computer Technical Tutorials & More

Valid CSS!

Vote for us at MyTechSupport's Top Tech
Sites!            

Linux Information


Home

Computing

Alcohol Recovery

Etch-A-Sketch Art

Powered by Slackware Linux Powered by Apache Web Server DNS Powered by ZoneEdit
Legal



© 2003 Fusion 13