View Full Version : batch file
10-25-2003, 02:28 PM
I want to wright a simple batch file just to see how they are put together and work, just something that will work from floppy, cd just to play with.
Can anyone help me out with whats needed.
10-25-2003, 05:21 PM
echo "Hello World!"
and save as "Helloworld.bat".
(the extension for batch files is .bat.)
I don't know if it's totally correct, but it should write "Hello World!" to your dosprompt screen.
Why don't you just look on the Web with google ?
10-26-2003, 03:51 AM
It is likely you already have some BAT files on your computer, so, do a search/find for *.bat and take a look at some of them with wordpad or similar editor.
10-26-2003, 10:34 AM
Batch files can be made interactive by using CHOICE. This requires CHOICE.COM, a tiny DOS app that comes with Windows 95/98, but is not included in Windows 2000/XP. In that case you could copy it from a Windows 98 system to your C:\Winnt directory. That isn't strictly legal but I doubt if Mr. Gates would be too upset :)
Here's a sample batch file illustrating how to make an interactive batch file using Choice:
echo Choose an Option
echo 1. Tell a lie
echo 2. Tell the truth
choice /C:12 Your choice:
if errorlevel 2 goto TRUTH
if errorlevel 1 goto LIE
echo The sky is blue!
echo The sky is green!
10-26-2003, 10:55 AM
How do i run it and from were?
Why i ask is im making and unattended xpcd with SP1, drivers, app and the like and i wanted to try wrighting a small .bat as a starter.
So if i copy/paste your .bat to notepad save as filename.bat that be ok?
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.