Home › Forums › Great Computer Tips And Tricks › What is??? How to??? › What is a batch file and how do you make a simple one? › Re: Re: What is a batch file and how do you make a simple one?
Ok, the next tutorial is another very simple oneopen your text editor again (notepad)and type:@Echo Hello World!@pausesave it as "Hello World.bat"when clicked a black box should pop up that says:Hello World!press any key to continue...That is how you make a batch file display anything you likeYou can also use multiple lines, like follows:@Echo Hello World!@Echo My name is Ryan!@pausethis will give you:Hello World!My name is Ryan!press any key to continuewith us so far?OKThe @ symbol tells the computer not to display the command, only the outputthe echo command tells the computer to display the text that follows on the same linethe pause command tells the computer to pause and wait for the user to press any key to continueWhen the computer reaches the end of a bat file, and has nothing to do, it closes, thats why we add the pause command, if we didnt have that the computer would have exited the program because it had nothing else to do. you wouldnt have been able to read the text...Also for those of you who read the thread mitz posted about the DIR command:any command (@echo Hello World!) for example, followed by a '>' and a name (>lol.txt) for example, so that it looks like this:@echo Hello World!>lol.txtwould take the output of the command (in this case 'Hello World!') and write it to the text file, so that nothing would display on the screen, and if we opened the text file we would see a single line that said:Hello World!