A batch file is a MS-DOS file which executes certain commands.. Lots of people think batch files are ‘nooby’, but if you know what you are doing they can actually be quite powerful..
98% of the Batch Files are undetectable & 2% are rarely detectable.. The best part is that, Batch Codings does’nt need any softwares, it can just be coded in simple notepad and
are saved as anything.bat..

Similar to job control language and other systems on mainframe and minicomputer systems, batch files were added to ease the work required for certain regular tasks by allowing the user to set up a batch script to automate many commands. When a batch file is run, the shell program (usually COMMAND.COM or cmd.exe) reads the file and executes its commands, normally line-by-line.

Microsoft Windows was introduced in 1985 as a GUI Operating System alternative to text-based operating and was designed to run on MS-DOS. In order to start it the WIN command was used and could be added to the end of the AUTOEXEC.BAT file to allow automatic loading of Windows. In the earlier versions one could run a .bat type file from Windows in the MS-DOS Prompt.

Windows was run from MS-DOS and used COMMAND.COM to run .bat files on the following operating systems:
*Windows 1, 2 and 3.
*Windows 95 and 98.
*Windows ME (access to real mode MS-DOS was restricted).

This example batch file is a simple program that displays a hello world program and then waits for the user to press a key before ending.
Code:

@ECHO off
ECHO Hello World!
PAUSE
ECHO on

Advanced batch example – Conditional Shutdown..
Code:

@echo off
color 3
title Conditional Shutdown
set /p name=enter a name:
:start
cls
echo Hi, %name%
echo.
echo 1.Shutdown
echo 2.Quit
set /p choice=enter your choice 1,2:
if %choice%==1 goto shutdown
if %choice%==2 exit

:shutdown
cls
set /p sec=enter the number of seconds that you wish the computer to shutdown in:
set /p msg=enter the shutdown message you wish to display:
shutdown -s -f -t %sec% -c “%msg%”
echo shutdown initiated at %time%
set /p cancel=type cancel to stop shutdown
if %cancel%==cancel shutdown -a
if %cancel%==cancel goto start

Microsoft has not officially released information pertaining to the future of Command Prompt (host for .bat and .cmd files) yet, but the company is now starting to include Windows PowerShell in releases for newer operating systems, which has all the core functions of Command Prompt and more (and instead of .bat and .cmd files, it runs .ps1 files). Yet it is important to remember that it is not certain this will replace Command Prompt, and that Microsoft is still making important tools for Command Prompt specifically, instead of for PowerShell (such as servermanagercmd.exe, which incorporates the entire set of Server Manager functions for Windows Server 2008)..

God bless us all 😉