Skip to main content

How To Create A Simple Batch File For Windows

 

 

How To Create A Simple Batch File For Windows

Hackers can create very dangerous batch files which can destroy your computer but here we are going to teach you on how to create a simple windows batch file. Batch files are created using Microsoft Notepad
How to create a simple batch file for windows
Step 1: Right-click on desktop and choose Text Document. Now you can see a plain text file when you open it.
Step 2: Google the commands which you need to create a simple batch file
Note: Below you find a simple batch file that displays some text.
Step 3: Type “@echo off” so that the code is not displayed in the final form.
Step 4: Next line type “echo” then press space and add the information you want to  display (example: echo my first batch program)
Step 5: Press enter to go next line and write “pause” so the windows stops.
Step 6: Now Save your file
Step 7: Give a name to your file and save it in .BAT extension.
Now your done! You have created a simple windows batch file. If you run the batch file you can see your batch file showing you the content which you have written after “echo“. You can also add title to your batch file by adding the code “title” (example: title Latest hacking news)
Capture
List of Batch commands  
  • APPEND  Set or display search path for files.
  • ASSIGN  The command redirects requests for disk operations on one drive to a different drive. It can also display drive assignments or reset all drive letters to their original assignments.
  • ATTRIB Change or view attributes of one or more files.
  • BACKUP and RESTORE Original commands to backup and restore files. Replaced later on by CPBACKUP or MSBACKUP
  • CALL  Invokes a Batch program from another Batch program
  • CHCP Displays or changes the active code page used to display character glyphs in a console window.
  • CHKDSK Checks a specific storage volume.
  • CHOICE Prompts user to choose from several options.
  • CLS Clears the terminal screen.
  • COPY Copies files to a specific location.
  • DATE Displays system date.
  • DEL and ERASE Delete one or more files.
  • DIR Shows contents of a directory.
  • ECHO Displays text on screen.
  • EXIT Closes the program.
  • FC and COMP Compares two files and shows differences.
  • FOR A loop syntax based on a set of conditions.
  • MD or MKDIR Creates a new directory.
  • MOVE Moves files to a specific location.
  • PATH Displays or sets a search path for executable files.
  • PAUSE Suspends all activity until user input.
  • RD and RMDIR Removes a directory.
  • REM Adds comment without any action.
  • REN Renames a file.
  • SORT Filters input data and sends it to output data stream.
  • TIME Displays system time.
  • TITLE Modifies the program title (shown in title bar).
  • UNDELETE Restores files deleted with the DEL command
  • XCOPY Copies entire directory tree.

Comments

Popular posts from this blog

How to find and remove duplicate files from PC uplicate files can cause all kinds of problems on your computer, taking up precious storage room, confusing your photo or media manager apps, and generally getting in the way of searches and other operations when you'd rather they didn't. You don't have to accept duplicate files as an inevitability of running a PC, though: Here's how to get rid of them. Duplicate files can crop up for all kinds of reasons: Maybe you downloaded a file, forgot it was there, and then downloaded it again; maybe you copied a folder of images and then never got around to getting rid of the originals. Whatever the reason, they clog up your disk space and shouldn't be left to gather dust. For the purposes of this guide we're going to use DupeGuru-it's Lifehacker's pick as the best duplicate file finder for Windows, and it's available for Mac and Linux as well. If you're not taken with DupeGuru, then some of the best al...

Gmail Automation

Gmail Automation: 5 Useful Google Scripts to Automate Your Gmail 1. Auto delete emails after X number of days Very often, after we read the email, we will just keep it in our inbox, regardless whether it is useful or not. While Google gives you tons of space to store your emails, you might still want to clean up your inbox and get rid of those useless emails. The following script can check emails with the “Delete Me” label and delete them after “x” number of days. 1. Go to  Google Scripts  and create a blank project (make sure you are logged into your Google account). Paste the following script and save it. function auto_delete_mails ( ) { var label = GmailApp.getUserLabelByName ( "Delete Me" ) ; if ( label == null ) { GmailApp.createLabel ( 'Delete Me' ) ; } else { var delayDays = 2 // Enter # of days before messages are moved to trash var maxDate = new Date ( ) ; maxDate.setDate ( maxDate.getDate ( ) -delay...

Dynamic Host Configuration Protocol (DHCP)

The Dynamic Host Configuration Protocol (DHCP) is a network service that enables host computers to be automatically assigned settings from a server as opposed to manually configuring each network host. Computers configured to be DHCP clients have no control over the settings they receive from the DHCP server, and the configuration is transparent to the computer's user. The most common settings provided by a DHCP server to DHCP clients include: IP address and netmask IP address of the default-gateway to use IP adresses of the DNS servers to use However, a DHCP server can also supply configuration properties such as: Host Name Domain Name Time Server Print Server The advantage of using DHCP is that changes to the network, for example a change in the address of the DNS server, need only be changed at the DHCP server, and all network hosts will be reconfigured the next time their DHCP clients poll the DHCP server. As an added advantage, it is also ...