write, save & run a batch file

Dell / Inpiron 1525
January 19, 2009 at 05:46:38
Specs: Windows Vista, 3 gb
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


See More: write, save & run a batch file

Report •


#1
January 19, 2009 at 07:42:17
[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


Report •

#2
January 19, 2009 at 14:26:52
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


Report •

#3
January 19, 2009 at 23:40:45
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


Report •

Related Solutions

#4
January 20, 2009 at 04:12:22
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


Report •

#5
January 20, 2009 at 04:17:52
Thanks very much


Report •


Ask Question