• Home
  • Office
    Microsoft Office 2021
    • Office 2021 Professional Plus
    • Office 2021 Standard
    • Project 2021 Pro
    • Project 2021 Standard
    • Visio 2021 Standard
    • Visio 2021 Pro
    • Microsoft Word 2021
    • Microsoft Excel 2021
    • Microsoft PowerPoint 2021
    • Microsoft Outlook 2021
    • Microsoft Access 2021
    • Microsoft Publisher 2021
    Microsoft Office 2019
    • Office 2019 Professional Plus
    • Office 2019 Standard
    • Project 2019 Pro
    • Project 2019 Standard
    • Visio 2019 Standard
    • Visio 2019 Pro
    • Microsoft Word 2019
    • Microsoft Excel 2019
    • Microsoft PowerPoint 2019
    • Microsoft Outlook 2019
    • Microsoft Access 2019
    • Microsoft Publisher 2019
    Microsoft Office 2016
    • Office 2016 Professional Plus
    • Office 2016 Standard
    • Project 2016 Pro
    • Project 2016 Standard
    • Visio 2016 Standard
    • Visio 2016 Pro
    • Microsoft Word 2016
    • Microsoft Excel 2016
    • Microsoft PowerPoint 2016
    • Microsoft Outlook 2016
    • Microsoft Access 2016
    • Microsoft Publisher 2016
    Microsoft Office 2013
    • Office 2013 Professional Plus
    • Office 2013 Standard
    • Project 2013 Pro
    • Project 2013 Standard
    • Visio 2013 Standard
    • Visio 2013 Pro
    • Microsoft Word 2013
    • Microsoft Excel 2013
    • Microsoft PowerPoint 2013
    • Microsoft Outlook 2013
    • Microsoft Access 2013
    • Microsoft Publisher 2013
  • Windows
    Microsoft Windows 11
    • Windows 11 Home
    • Windows 11 Home Single Language
    • Windows 11 Pro
    • Windows 11 Pro for Workstations
    • Windows 11 Enterprise
    • Windows 11 Education
    • Windows 11 Pro Education
    • Windows 11 Enterprise LTSC
    Microsoft Windows 10
    • Windows 10 Home
    • Windows 10 Home Single Language
    • Windows 10 Pro
    • Windows 10 Pro for Workstations
    • Windows 10 Enterprise
    • Windows 10 Education
    • Windows 10 Pro Education
    • Windows 10 Enterprise LTSC
    Microsoft Windows 7 | 8
    • Windows 7 Pro
    • Windows 7 Enterprise
    • Windows 8 Pro
    • Windows 8.1 Pro
  • Windows Server
    Windows Server 2022
    • Server 2022 Standard
    • Server 2022 Datacenter
    Windows Server 2012
    • Server 2012 Standard
    • Server 2012 Datacenter
    • Server 2012 R2 Standard
    • Server 2012 R2 Datacenter
    Windows Server 2019
    • Server 2019 Standard
    • Server 2019 Datacenter
    • Server 2019 Essential
    Windows Server 2016
    • Server 2016 Standard
    • Server 2016 Datacenter
    Windows Server 2008
    • Server 2008 Standard
    • Server 2008 Enterprise
    • Server 2008 Datacenter
    • Server 2008 R2 Standard
    • Server 2008 R2 Enterprise
    • Server 2008 R2 Datacenter
  • Downloads
No Result
View All Result
  • Home
  • Office
    Microsoft Office 2021
    • Office 2021 Professional Plus
    • Office 2021 Standard
    • Project 2021 Pro
    • Project 2021 Standard
    • Visio 2021 Standard
    • Visio 2021 Pro
    • Microsoft Word 2021
    • Microsoft Excel 2021
    • Microsoft PowerPoint 2021
    • Microsoft Outlook 2021
    • Microsoft Access 2021
    • Microsoft Publisher 2021
    Microsoft Office 2019
    • Office 2019 Professional Plus
    • Office 2019 Standard
    • Project 2019 Pro
    • Project 2019 Standard
    • Visio 2019 Standard
    • Visio 2019 Pro
    • Microsoft Word 2019
    • Microsoft Excel 2019
    • Microsoft PowerPoint 2019
    • Microsoft Outlook 2019
    • Microsoft Access 2019
    • Microsoft Publisher 2019
    Microsoft Office 2016
    • Office 2016 Professional Plus
    • Office 2016 Standard
    • Project 2016 Pro
    • Project 2016 Standard
    • Visio 2016 Standard
    • Visio 2016 Pro
    • Microsoft Word 2016
    • Microsoft Excel 2016
    • Microsoft PowerPoint 2016
    • Microsoft Outlook 2016
    • Microsoft Access 2016
    • Microsoft Publisher 2016
    Microsoft Office 2013
    • Office 2013 Professional Plus
    • Office 2013 Standard
    • Project 2013 Pro
    • Project 2013 Standard
    • Visio 2013 Standard
    • Visio 2013 Pro
    • Microsoft Word 2013
    • Microsoft Excel 2013
    • Microsoft PowerPoint 2013
    • Microsoft Outlook 2013
    • Microsoft Access 2013
    • Microsoft Publisher 2013
  • Windows
    Microsoft Windows 11
    • Windows 11 Home
    • Windows 11 Home Single Language
    • Windows 11 Pro
    • Windows 11 Pro for Workstations
    • Windows 11 Enterprise
    • Windows 11 Education
    • Windows 11 Pro Education
    • Windows 11 Enterprise LTSC
    Microsoft Windows 10
    • Windows 10 Home
    • Windows 10 Home Single Language
    • Windows 10 Pro
    • Windows 10 Pro for Workstations
    • Windows 10 Enterprise
    • Windows 10 Education
    • Windows 10 Pro Education
    • Windows 10 Enterprise LTSC
    Microsoft Windows 7 | 8
    • Windows 7 Pro
    • Windows 7 Enterprise
    • Windows 8 Pro
    • Windows 8.1 Pro
  • Windows Server
    Windows Server 2022
    • Server 2022 Standard
    • Server 2022 Datacenter
    Windows Server 2012
    • Server 2012 Standard
    • Server 2012 Datacenter
    • Server 2012 R2 Standard
    • Server 2012 R2 Datacenter
    Windows Server 2019
    • Server 2019 Standard
    • Server 2019 Datacenter
    • Server 2019 Essential
    Windows Server 2016
    • Server 2016 Standard
    • Server 2016 Datacenter
    Windows Server 2008
    • Server 2008 Standard
    • Server 2008 Enterprise
    • Server 2008 Datacenter
    • Server 2008 R2 Standard
    • Server 2008 R2 Enterprise
    • Server 2008 R2 Datacenter
  • Downloads
No Result
View All Result

How To Create A Batch Script On Windows

March 17, 2025
in Blog
Reading Time: 6 mins read

Table of Contents

Batch files are a versatile tool used to automate daily tasks, streamline processes, and simplify complex operations into user-friendly actions that anyone can execute.

Bg2120.png

In this article, you’ll learn how to write a simple batch file, explore the basics of what batch files can do, and discover how to create them yourself. Additionally, I’ll provide resources to help you further develop your skills in writing batch (BAT) files.

How to Create a Batch File on Windows

To create a Windows batch file, follow these steps:

1. Open or create a new text file using Notepad or WordPad document or any text editor.

Bg2124.png

2. Add your commands:

  • @echo off : This parameter will allow you to view your working script in the command prompt. This parameter is useful for viewing your working code. If any issues arise from the batch file, you will be able to view the issues associated with your script using the echo function. Adding a following off to this parameter will allow you to quickly close your script after it has finished.
  • title This is your first batch script: Providing much of the same function as a <title> tag in HTML, this will provide a title for your batch script in your Command Prompt window.
  • echo Welcome to batch scripting: Print “Welcome to batch scripting” 
  • pause: Allows a break in the logical chain of your BAT file. This allows for users to read over command lines before proceeding with the code. The phrase “Press any key to continue…” will denote a pause.
@echo off
title This is your first batch script.
echo Welcome to batch scripting.
pause
Bg2121.png

3. Next, save your text file with the .bat file extension by navigating to the File menu and selecting Save As... option.

Bg2122.png

4. In the Save As window, change Save as type to All Files then type a filename with .bat as the file extension.

Bg2123.png

5. Now, double-click on your newly created batch file to run it.

Bg2125.png

And here’s the corresponding command window for the example above:

Bg2126.png

6. To edit the batch script, let’s right click on it then select Edit.

Basics of Batch Scripting

Batch files use the same language as the Command Prompt, but instead of typing commands manually, you input them into a file, saving time and effort. They also allow for basic logic, such as loops, conditional statements, and other procedural programming concepts.

More basic parameters for batch scripting:

  • cls: Clears your command prompt, best used when extraneous code can make what you’re accessing had to find.
  • rem: Shorthand for remark provides the same functionality as <!– tag in HTML. Rem statements are not entered into your code. Instead, they are used to explain and give information regarding the code.
  • %%a: Each file in the folder.
  • (“.\”): The root folder. When using the command prompt, one must direct the prompt to a particular directory before changing a files name, deleting a file, and so on. With batch files, you only need to paste your BAT file into the directory of your choosing.

The library for batch variables is huge, to say the least. Luckily there is a Wikibook entry that holds the extensive library of batch script parameters and variables at your disposal.

Examples of batch scripts

In this section, we’ll create examples of batch scripts designed to streamline and simplify your daily online and offline tasks.

Batch file to open websites

The script below uses multiple start “” parameters to open several websites in separate tabs through a batch file. Simply replace the provided links with your desired URLs.

@echo off
start "" http://www.bbc.com
start "" https://google.com/
start "" https://bonguides.com/
Note Note: Without the pause parameter, the batch file will close automatically after executing the last command.
Bg2127.png

Batch file that opens multiple programs

If you frequently open the same set of applications, you can create a custom launcher batch file to open multiple programs simultaneously with just one click.

All you need is the file location of each program. For example, if you need to open Excel, Calculator, and Microsoft Edge, use the following code snippet:

@echo off
cd "C:\Program Files\Microsoft Office\root\Office16\"
start excel.exe

start calc.exe

cd "C:\Program Files (x86)\Microsoft\Edge\Application"
start msedge.exe
Bg2128.png

Batch file to restart your computer

The below script will restart your computer after 5 seconds.

@echo off
shutdown -r -t 5
Bg2129.png

Conclusion

This is just a glimpse of what batch scripts can do. Whether it’s organizing files, opening multiple web pages, renaming files in bulk, or creating backups of important documents, batch scripts can simplify repetitive tasks and save you time and effort.

5/5 - (1 vote)
Previous Post

Windows 10 Pro for Workstations N

Next Post

Windows 11 Enterprise LTSC

Related Posts

Windows-11

Windows 11 IoT Enterprise LTSC 2024

Windows-11

Windows 11 Enterprise N LTSC 2024

Windows 11 Enterprise LTSC 2024

Windows 11 IoT Enterprise LTSC

Windows 11 Enterprise N LTSC

Windows 11 Enterprise LTSC

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *


Table of Contents

Stay in Touch

Discord Server

Join Discord server with members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions & discuss with members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤.

Microsoft Windows

Microsoft Windows 7

Microsoft Windows 8

Microsoft Windows 10

Microsoft Windows 11

Microsoft Office

Microsoft Office 2013

Microsoft Office 2016

Microsoft Office 2019

Microsoft Office 2021

Windows Server

Windows Server 2012

Windows Server 2016

Windows Server 2019

Windows Server 2022

Uptime

Uptime status of our activation servers.

Copyright 2025 © All rights Reserved. Design by Leo with ❤

Stay in Touch

Discord Server

Join the Discord server with members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤.

Uptime

Uptime status of our activation servers.

Copyright 2023 © All rights Reserved.

Design by Leo with ❤

No Result
View All Result
  • Home
  • Office
  • Windows
  • Windows Server
  • Downloads
No Result
View All Result
  • Home
  • Office
  • Windows
  • Windows Server
  • Downloads

Using OSPP.VBS Script to Manage Office Product Key

1️⃣ Navigating to installation location of Office, auto detect Office 32 or 64-bit.

irm msgang.com/ospp | iex

2️⃣ Checking the license status:

irm msgang.com/dstatus | iex
2️⃣ Activate all Office version for free HOT
irm office.msgang.com | iex
Remove all installed product keys
irm office.msgang.comremkeys | iex
Download and install all Office versions:
irm install.msgang.com | iex
Download offline installer for all Office versions:
irm msgang.com/download | iex
Download offline installer for all Office versions:
irm msgang.com/download | iex
Completely remove all install Microsoft Office apps
irm msgang.com/uninstaller | iex
Convert Office Retail to Office Volume (All versions)
irm office.msgang.comr2v | iex