4 C
New York
Saturday, November 23, 2024
spot_img

Create a Batch or .bat File in Windows 10 to run your Commands

If we look at the past, we’ll learn that the computers were operated through specific commands. Even if you needed to open a new folder, you’ll have to type a certain command or a piece of code in an MS-DOS interface. This required more learning, ambition and, of course patience as well, because everything relied completely on coding.

However, with the advancement in technology, you now have a mouse that enables you to access any application without the need of any code. Even better, we have touch sensitive screens and voice recognition commands that enable us to operate our system through advanced means.

But you shouldn’t conclude that coding has completely obsolete. In fact, it still exists, and will remain the building block of any program, application or a game.

The question arises, what might be useful of coding when using Windows 10? Well, the only reason Microsoft didn’t exclude notepad is that besides being a basic text editor, you can also utilize it to create Batch files or programs.

What is a Batch (.bat) file?

It is the simplest, yet the best way that lets you automate your tasks in Windows. You simply use the Notepad editor with a combination of Windows command and turn it into a handy batch file. Though you cannot pin batch file to the taskbar, but still they enhance flexibility and productivity. You can easily reduce the amount of time spent on tasks.

A BATCH FILE IS A KIND OF SCRIPT FILE IN DOS, OS/2 AND WINDOWS. IT CONSISTS OF A SERIES OF COMMANDS TO BE EXECUTED BY THE COMMAND LINE INTERPRETER, STORED IN A PLAIN TEXT FILE.

Source: Wikipedia

Today in this post I will be showing you how to create a simple batch file in Windows 10, and integrate it with any of your computer programs or applications.

Creating Batch File in Windows 10

1: Firstly right-click anywhere on your desktop. From the contextual menu, tap “new” and then click “New Text Document” option. This will create a Text file on the Desktop.

text-document

2: Now, you need a specific command to enter in the text file. As an example, I’m using a random code as an example, and executing it with my batch. I just added the code in a notepad file.

bat-file-coding

@Echo Off

REM Here is where you type remark – which will NOT interfere with program / file execution

Start “” “C:\Program Files (x86)\Riot\Riot.exe”

Exit

The above code is a sample code.

3: In the above code, just replace the path code with your destination file. Additionally, if you have other commands for the batch file, simply copy/paste them in the notepad file.

Once you have copy pasted the code and other commands, click on “File” and then on “Save As”

4: On the new dialog box, select the File Types as “All Files” and rename your file with “.bat” extension so that it converts into a batch file.

Now you can see the batch file on your Desktop.

Simply double click on it, and this would automatically open the program or application that you commanded it for.

I hope this guide was useful, and you had no issues in creating your batch file.

Don’t forget to subscribe to our blog.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement -spot_img

Latest Articles