So lets start at the beginning
What is a batch file?
A batch is a list command line instructions that have been batched together ( Kinda like the name says ) into one file. They're not really programs, but they are the backbone of windows... don't believe me see for yourself go into your C:\windows folder there are a lot of .bat \ .sys \ .cfg \ .INF and other types of files. But I wouldn't delete any of them because if you do you may disable your OS
So now lets get to some of the commands used in making a batch file:
echo - displays a text message in the DOS window like " HI ALL"
if you put @ before it means not to echo that line
cls - clears the screen ( DOS window not the monitor)
del - deletes a file
deltree - its kinda like del but deletes all of the files in a folder
copy - this copies the batch file to a directory ( folder )
end - ends the script
start - starts a program.exe [ example ]
say I wanted to start notepad it would look something like this
Start C:\windows\system32\notepad.exe or just
start notepad.exe ( cool eh? )
pause - it pauses the commands until you hit a button
call - calls up another batch file from in a folder or somewhere else on the computer
color - changes the color of the font and/or the background [ example ]
0 = Black 8 = Gray
1 = Blue 9 = Light Blue
2 = Green A = Light Green
3 = Aqua B = Light Aqua
4 = Red C = Light Red
5 = Purple D = Light Purple
6 = Yellow E = Light Yellow
7 = White F = Bright White
so something like this [ color 0C ]
ren - renames a file or folder
there are more commands, but I'm still learning them all myself. So anyway lets make something with what we just learned:
@echo on
color 2
echo "Hello, I hope you enjoy this tutorial"
copy C:\Program Files\new folder
del C:\Program Files\new folder
pause
cls
Start notepad.exe
End
OK save it as [ test.bat ] and look at that your very own batch file
what you think?
well that's all for me tonight I hope you enjoyed learning something new.


