Computing.Net > Forums > Programming > write, save & run a batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

write, save & run a batch file

Reply to Message Icon

Name: fish
Date: January 19, 2009 at 05:46:38 Pacific
OS: Windows Vista
CPU/Ram: 3 gb
Product: Dell / Inpiron 1525
Subcategory: Batch
Comment:

Some simple questions about batch files

1.) Do you write a batch file in NOTEPAD?
2.) Once created, do you save the file as follows: filename.bat
3.) Once saved - how do you run or execute the file created?

Excuse my ignorance- I have to start somewhere.

Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: January 19, 2009 at 07:42:17 Pacific
Reply:

[1] Any TEXT editor. No formatting, like word wrap.

[2] yes

[3] Type it's name at a CMD prompt and press ENTER.

Yep, gotta start somewhere. I guess you're ready for the thrill of victory and the agony of defeat.

:(


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 2
Name: lee123abc
Date: January 19, 2009 at 14:26:52 Pacific
Reply:

try save this in a bat file... call it 1.bat

cls
echo this is going to put whatever you type into a file on your c drive called 1.txt
pause
c:
cd\
echo type something here
set /p user1=
echo %user1% >> 1.txt
echo ================== >> 1.txt
cls
echo type something else
set /p user2=
echo %user2% >> 2.txt
cls
echo if there is anything else you would like a hand with, let me know.
echo bye
start 1.txt
cls
echo press any key now to exit batfile
pause>nul
goto :eof


0

Response Number 3
Name: fish
Date: January 19, 2009 at 23:40:45 Pacific
Reply:

one more...before I start

Q4) Where do you save the batch file to?
c: ? ; or into a folder for batch files? ; or into the folder where you want the operational functions coded for to be executed?; elsewhere?

Thanks
so much


0

Response Number 4
Name: Mechanix2Go
Date: January 20, 2009 at 04:12:22 Pacific
Reply:

Put it where it suits you. But NOT in the root nor the Windows directory nor anywhere it can make a mess.


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 5
Name: fish
Date: January 20, 2009 at 04:17:52 Pacific
Reply:

Thanks very much


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: write, save & run a batch file

How to run a batch file on another www.computing.net/answers/programming/how-to-run-a-batch-file-on-another-/15653.html

how to call a batch file from html www.computing.net/answers/programming/how-to-call-a-batch-file-from-html/1539.html

Running a .bat file www.computing.net/answers/programming/running-a-bat-file/18164.html