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”


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 as

Now you can see the batch file on your Desktop.batch created

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.


  1. Thank you for your useful explanation.

    I have a little challenge perhaps you can help me with ?

    I have a little batch file that I use unchanged in WnXP and Win7 – but it doesn’t work in WinX !

    Our printer sometimes seizes up, and this .BAT simply clears the printer queue:-
    @echo off
    net stop “print spooler”
    del /q “%SystemRoot%\system32\spool\PRINTERS\*.*”
    net start “print spooler”
    ping localhost -n 5 > nul

  2. I wonder if you can help me with a small batch file I use o clean out the temp directories. It worker up to Windows 8 but does not work in Windows 10. I’e tries changing a few things to get it to work but no success.

    Here is the file a guy created for me:
    @echo off
    echo. Cleaning out the Temp directory
    del /f /s /q “%Temp%” 1>c:\DelTemp.txt 2>&1
    date /T >>C:\DelTemp.txt
    time /T 1:36p >>C:\Users\dvonj\Documents\DelTemp.txt
    REM notepad C:\Users\dvonj\Documents\DelTemp.txt
    type C:\Users\dvonj\Documents\DelTemp.txt >> C:\Users\dvonj\Documents\DelTemp1.txt

    It writes the two DelTemp.txt files but only has the time it was executed.

  3. Thanks for the info. I have what I find to be a big challenge but I’m sure you will find it easy. I have a dual screen setup at work and everyday, when I reboot the computer my company’s boot script changes our desktop background wallpaper. I have to change the wall paper manually for both screens everyday. How can I write a batch file to do this automatically?