How To Create A Batch Script On Windows

Updated Jun 3, 20264 min read

Batch files are a handy way to automate everyday tasks, make processes more efficient, and turn complicated operations into simple, user-friendly actions that anyone can run.

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 tag in HTML, this will provide a title for your batch script in your Command Prompt window.</li> <li><strong>echo Welcome to batch scripting</strong>: Print “Welcome to batch scripting**”** </li> <li><strong>pause</strong>: 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.</li> </ul> <div class="code-block" data-lang="bash"> <div class="code-block-head"> <span class="code-block-lang">bash</span> <button type="button" class="code-wrap" aria-label="Toggle line wrap" title="Wrap long lines">↵</button> <button type="button" class="code-fullscreen" aria-label="View fullscreen" title="Fullscreen">⛶</button> <button type="button" class="code-copy" aria-label="Copy code"></button> </div> <pre class="shiki" style="background-color:#282c34;color:#abb2bf"><code><span class="code-line" data-line="1"><span style="color:#61AFEF">@echo</span><span style="color:#98C379"> off</span></span><span class="code-line" data-line="2"><span style="color:#61AFEF">title</span><span style="color:#98C379"> This</span><span style="color:#98C379"> is</span><span style="color:#98C379"> your</span><span style="color:#98C379"> first</span><span style="color:#98C379"> batch</span><span style="color:#98C379"> script.</span></span><span class="code-line" data-line="3"><span style="color:#56B6C2">echo</span><span style="color:#98C379"> Welcome</span><span style="color:#98C379"> to</span><span style="color:#98C379"> batch</span><span style="color:#98C379"> scripting.</span></span><span class="code-line" data-line="4"><span style="color:#61AFEF">pause</span></span></code></pre> </div><p><picture> <source type="image/webp" srcset="/uploads/83fd36b42cf7-320w.webp 320w, /uploads/83fd36b42cf7-640w.webp 640w, /uploads/83fd36b42cf7.webp 768w" sizes="(max-width: 860px) 100vw, 860px"> <img src="/uploads/83fd36b42cf7.png" srcset="/uploads/83fd36b42cf7-320w.png 320w, /uploads/83fd36b42cf7-640w.png 640w, /uploads/83fd36b42cf7.png 768w" sizes="(max-width: 860px) 100vw, 860px" alt="Bg2121.png" width="768" height="188" loading="lazy" decoding="async"> </picture></p> <p>3. Next, save your text file with the <strong>.bat</strong> file extension by navigating to the File menu and selecting <strong>Save As..</strong>. option.</p> <p><picture> <source type="image/webp" srcset="/uploads/1aeb1e261568-320w.webp 320w, /uploads/1aeb1e261568-640w.webp 640w, /uploads/1aeb1e261568.webp 768w" sizes="(max-width: 860px) 100vw, 860px"> <img src="/uploads/1aeb1e261568.png" srcset="/uploads/1aeb1e261568-320w.png 320w, /uploads/1aeb1e261568-640w.png 640w, /uploads/1aeb1e261568.png 768w" sizes="(max-width: 860px) 100vw, 860px" alt="Bg2122.png" width="768" height="276" loading="lazy" decoding="async"> </picture></p> <p>4. In the Save As window:</p> <ul> <li>Change <strong>Save as type</strong> to <strong>All Files</strong></li> <li>Then type a filename with <strong>.bat</strong> as the file extension.</li> </ul> <p><picture> <source type="image/webp" srcset="/uploads/2db1ad1c7c5e-320w.webp 320w, /uploads/2db1ad1c7c5e-640w.webp 640w, /uploads/2db1ad1c7c5e.webp 768w" sizes="(max-width: 860px) 100vw, 860px"> <img src="/uploads/2db1ad1c7c5e.png" srcset="/uploads/2db1ad1c7c5e-320w.png 320w, /uploads/2db1ad1c7c5e-640w.png 640w, /uploads/2db1ad1c7c5e.png 768w" sizes="(max-width: 860px) 100vw, 860px" alt="Bg2123.png" width="768" height="368" loading="lazy" decoding="async"> </picture></p> <p>5. Now, <strong>double-click</strong> on your newly created batch file to run it.</p> <p><picture> <source type="image/webp" srcset="/uploads/3b9bfdb24a64-320w.webp 320w, /uploads/3b9bfdb24a64-640w.webp 640w, /uploads/3b9bfdb24a64.webp 768w" sizes="(max-width: 860px) 100vw, 860px"> <img src="/uploads/3b9bfdb24a64.png" srcset="/uploads/3b9bfdb24a64-320w.png 320w, /uploads/3b9bfdb24a64-640w.png 640w, /uploads/3b9bfdb24a64.png 768w" sizes="(max-width: 860px) 100vw, 860px" alt="Bg2125.png" width="768" height="405" loading="lazy" decoding="async"> </picture></p> <p>And here’s the corresponding command window for the example above:</p> <p><picture> <source type="image/webp" srcset="/uploads/cd106a075240-320w.webp 320w, /uploads/cd106a075240-640w.webp 640w, /uploads/cd106a075240.webp 768w" sizes="(max-width: 860px) 100vw, 860px"> <img src="/uploads/cd106a075240.png" srcset="/uploads/cd106a075240-320w.png 320w, /uploads/cd106a075240-640w.png 640w, /uploads/cd106a075240.png 768w" sizes="(max-width: 860px) 100vw, 860px" alt="Bg2126.png" width="768" height="194" loading="lazy" decoding="async"> </picture></p> <p>6. To edit the batch script, let’s right click on it then select <strong>Edit</strong>.</p> <h3>Basics of Batch Scripting</h3> <p>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.</p> <p>More basic parameters for batch scripting:</p> <ul> <li><strong>cls</strong>: Clears your command prompt, best used when extraneous code can make what you’re accessing had to find.</li> <li><strong>rem</strong>: 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.</li> <li><strong>%%a</strong>: Each file in the folder.</li> <li><strong>(“.\”)</strong>: 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.</li> </ul> <p>The library for batch variables is huge, to say the least. Luckily there is a <a href="https://en.wikibooks.org/wiki/Windows_Batch_Scripting" target="_blank" rel="noopener noreferrer">Wikibook entry</a> that holds the extensive library of batch script parameters and variables at your disposal.</p> <h3>Examples of batch scripts</h3> <p>In this section, we’ll create examples of batch scripts designed to streamline and simplify your daily online and offline tasks.</p> <h3><a href="https://bonguides.com/how-to-open-multiple-urls-in-a-browser-using-a-batch-file/" target="_blank" rel="noopener noreferrer">Batch file to open websites</a></h3> <p>The script below uses multiple <strong>start “”</strong> parameters to open several websites in separate tabs through a batch file. Simply replace the provided links with your desired URLs.</p> <div class="code-block" data-lang="bash"> <div class="code-block-head"> <span class="code-block-lang">bash</span> <button type="button" class="code-wrap" aria-label="Toggle line wrap" title="Wrap long lines">↵</button> <button type="button" class="code-fullscreen" aria-label="View fullscreen" title="Fullscreen">⛶</button> <button type="button" class="code-copy" aria-label="Copy code"></button> </div> <pre class="shiki" style="background-color:#282c34;color:#abb2bf"><code><span class="code-line" data-line="1"><span style="color:#61AFEF">@echo</span><span style="color:#98C379"> off</span></span><span class="code-line" data-line="2"><span style="color:#61AFEF">start</span><span style="color:#98C379"> ""</span><span style="color:#98C379"> http://www.bbc.com</span></span><span class="code-line" data-line="3"><span style="color:#61AFEF">start</span><span style="color:#98C379"> ""</span><span style="color:#98C379"> https://google.com/</span></span><span class="code-line" data-line="4"><span style="color:#61AFEF">start</span><span style="color:#98C379"> ""</span><span style="color:#98C379"> https://bonguides.com/</span></span></code></pre> </div><p>Note <strong>Note:</strong> Without the pause parameter, the batch file will close automatically after executing the last command. <picture> <source type="image/webp" srcset="/uploads/28d35699cc89-320w.webp 320w, /uploads/28d35699cc89-640w.webp 640w, /uploads/28d35699cc89.webp 768w" sizes="(max-width: 860px) 100vw, 860px"> <img src="/uploads/28d35699cc89.png" srcset="/uploads/28d35699cc89-320w.png 320w, /uploads/28d35699cc89-640w.png 640w, /uploads/28d35699cc89.png 768w" sizes="(max-width: 860px) 100vw, 860px" alt="Bg2127.png" width="768" height="224" loading="lazy" decoding="async"> </picture></p> <h3>Batch file that opens multiple programs</h3> <p>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.</p> <p>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:</p> <div class="code-block" data-lang="bash"> <div class="code-block-head"> <span class="code-block-lang">bash</span> <button type="button" class="code-wrap" aria-label="Toggle line wrap" title="Wrap long lines">↵</button> <button type="button" class="code-fullscreen" aria-label="View fullscreen" title="Fullscreen">⛶</button> <button type="button" class="code-copy" aria-label="Copy code"></button> </div> <pre class="shiki" style="background-color:#282c34;color:#abb2bf"><code><span class="code-line" data-line="1"><span style="color:#61AFEF">@echo</span><span style="color:#98C379"> off</span></span><span class="code-line" data-line="2"><span style="color:#56B6C2">cd</span><span style="color:#98C379"> "C:\Program Files\Microsoft Office\root\Office16</span><span style="color:#56B6C2">\"</span></span><span class="code-line" data-line="3"><span style="color:#98C379">start excel.exe</span></span><span class="code-line" data-line="4"></span><span class="code-line" data-line="5"><span style="color:#98C379">start calc.exe</span></span><span class="code-line" data-line="6"></span><span class="code-line" data-line="7"><span style="color:#98C379">cd "C:</span><span style="color:#56B6C2">\P</span><span style="color:#98C379">rogram</span><span style="color:#98C379"> Files</span><span style="color:#ABB2BF"> (x86)</span><span style="color:#56B6C2">\M</span><span style="color:#ABB2BF">icrosoft</span><span style="color:#56B6C2">\E</span><span style="color:#ABB2BF">dge</span><span style="color:#56B6C2">\A</span><span style="color:#ABB2BF">pplication</span><span style="color:#98C379">"</span></span><span class="code-line" data-line="8"><span style="color:#98C379">start msedge.exe</span></span></code></pre> </div><p><picture> <source type="image/webp" srcset="/uploads/fa1146fc9a9c-320w.webp 320w, /uploads/fa1146fc9a9c-640w.webp 640w, /uploads/fa1146fc9a9c.webp 768w" sizes="(max-width: 860px) 100vw, 860px"> <img src="/uploads/fa1146fc9a9c.png" srcset="/uploads/fa1146fc9a9c-320w.png 320w, /uploads/fa1146fc9a9c-640w.png 640w, /uploads/fa1146fc9a9c.png 768w" sizes="(max-width: 860px) 100vw, 860px" alt="Bg2128.png" width="768" height="178" loading="lazy" decoding="async"> </picture></p> <h3>Batch file to restart your computer</h3> <p>The below script will restart your computer after 5 seconds.</p> <div class="code-block" data-lang="bash"> <div class="code-block-head"> <span class="code-block-lang">bash</span> <button type="button" class="code-wrap" aria-label="Toggle line wrap" title="Wrap long lines">↵</button> <button type="button" class="code-fullscreen" aria-label="View fullscreen" title="Fullscreen">⛶</button> <button type="button" class="code-copy" aria-label="Copy code"></button> </div> <pre class="shiki" style="background-color:#282c34;color:#abb2bf"><code><span class="code-line" data-line="1"><span style="color:#61AFEF">@echo</span><span style="color:#98C379"> off</span></span><span class="code-line" data-line="2"><span style="color:#61AFEF">shutdown</span><span style="color:#D19A66"> -r</span><span style="color:#D19A66"> -t</span><span style="color:#D19A66"> 5</span></span></code></pre> </div><p><picture> <source type="image/webp" srcset="/uploads/c8f3ec5f1b0c-320w.webp 320w, /uploads/c8f3ec5f1b0c-640w.webp 640w, /uploads/c8f3ec5f1b0c.webp 768w" sizes="(max-width: 860px) 100vw, 860px"> <img src="/uploads/c8f3ec5f1b0c.png" srcset="/uploads/c8f3ec5f1b0c-320w.png 320w, /uploads/c8f3ec5f1b0c-640w.png 640w, /uploads/c8f3ec5f1b0c.png 768w" sizes="(max-width: 860px) 100vw, 860px" alt="Bg2129.png" width="768" height="244" loading="lazy" decoding="async"> </picture></p> <div class="info-card info-card--note"><h3>Conclusion</h3> <p>Hello Friends! My name is Leo, and I’m excited to share everything I know about activating Microsoft software products. In the past, I managed several YouTube channels on this topic, but they were taken down by Microsoft. That’s why I decided to start this blog to keep the conversation alive without interruptions. I’m committed to sharing my knowledge and insights for as long as possible!</p> <p>If you have any questions or concerns, feel free to leave a comment or visit my <a href="https://discord.gg/kNZs7Wwvgb" target="_blank" rel="noopener noreferrer">Discord server</a>. I’d be happy to provide more details. Thank you so much for your feedback and support!</p> <p><a href="https://ko-fi.com/msgang" target="_blank" rel="noopener noreferrer"><picture> <source type="image/webp" srcset="/uploads/a17abe6216f8-320w.webp 320w, /uploads/a17abe6216f8-640w.webp 640w, /uploads/a17abe6216f8.webp 1024w" sizes="(max-width: 860px) 100vw, 860px"> <img src="/uploads/a17abe6216f8.png" srcset="/uploads/a17abe6216f8-320w.png 320w, /uploads/a17abe6216f8-640w.png 640w, /uploads/a17abe6216f8.png 1024w" sizes="(max-width: 860px) 100vw, 860px" alt="Buy Me A Coffee" width="1024" height="287" loading="lazy" decoding="async"> </picture></a></p> </div><div class="info-card info-card--links"><p>Want to activate others Microsoft products for free? You can follow the below posts:</p> <ul> <li><a href="/category/microsoft-windows/" rel="noopener noreferrer" target="_blank">Windows 7/8/8.1/10/11</a></li> <li><a href="/category/windows-server/" title="/how-to-activate-all-windows-editions-for-free/" rel="noopener noreferrer" target="_blank">Windows Servers 2008/2012/2016/2019/2022</a></li> <li><a href="/category/microsoft-office/" rel="noopener noreferrer" target="_blank">Microsoft Office 2013/2016/2019/2021 (included Visio and Project)</a></li> </ul></div> </div></article><div style="margin-top:2rem;display:flex;flex-wrap:wrap;align-items:center;gap:0.15rem 0.6rem"><span style="font-weight:600;font-size:0.95rem">Rating</span><div role="group" aria-label="Rate this post" style="display:inline-flex;gap:0.1rem"><button type="button" disabled="" aria-label="1 star" aria-pressed="false" style="background:none;border:0;padding:1px;cursor:default;transition:transform 0.1s;transform:none"><svg width="20" height="20" viewBox="0 0 24 24" aria-hidden="true" style="display:block" fill="none" stroke="#7c8294" stroke-width="1.3" stroke-linejoin="round"><path d="M12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26z"></path></svg></button><button type="button" disabled="" aria-label="2 stars" aria-pressed="false" style="background:none;border:0;padding:1px;cursor:default;transition:transform 0.1s;transform:none"><svg width="20" height="20" viewBox="0 0 24 24" aria-hidden="true" style="display:block" fill="none" stroke="#7c8294" stroke-width="1.3" stroke-linejoin="round"><path d="M12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26z"></path></svg></button><button type="button" disabled="" aria-label="3 stars" aria-pressed="false" style="background:none;border:0;padding:1px;cursor:default;transition:transform 0.1s;transform:none"><svg width="20" height="20" viewBox="0 0 24 24" aria-hidden="true" style="display:block" fill="none" stroke="#7c8294" stroke-width="1.3" stroke-linejoin="round"><path d="M12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26z"></path></svg></button><button type="button" disabled="" aria-label="4 stars" aria-pressed="false" style="background:none;border:0;padding:1px;cursor:default;transition:transform 0.1s;transform:none"><svg width="20" height="20" viewBox="0 0 24 24" aria-hidden="true" style="display:block" fill="none" stroke="#7c8294" stroke-width="1.3" stroke-linejoin="round"><path d="M12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26z"></path></svg></button><button type="button" disabled="" aria-label="5 stars" aria-pressed="false" style="background:none;border:0;padding:1px;cursor:default;transition:transform 0.1s;transform:none"><svg width="20" height="20" viewBox="0 0 24 24" aria-hidden="true" style="display:block" fill="none" stroke="#7c8294" stroke-width="1.3" stroke-linejoin="round"><path d="M12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26z"></path></svg></button></div><span style="color:#7c8294;font-size:0.9rem">be the first to rate</span></div><section style="margin-top:3rem;padding-top:2rem;border-top:1px solid var(--border)"><h2 style="font-size:1.1rem;font-weight:700;margin-bottom:1rem">Comments </h2><div style="color:var(--muted);font-size:0.9em">Loading comments…</div><ul style="list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:0.75rem"></ul><div style="margin-top:0;padding:1.1rem 1.25rem;background:var(--surface);border:1px solid var(--border);border-radius:12px"><h3 style="font-size:1rem;font-weight:600;margin:0 0 0.75rem">Leave a comment</h3><form style="display:grid;gap:0.75rem"><div class="form-row-2"><input required="" aria-label="Name" placeholder="Name *" style="width:100%;background:var(--bg);border:1px solid var(--border);border-radius:4px;padding:0.5rem 0.75rem;color:var(--fg);font-size:0.95em;font-family:inherit" value=""/><input type="email" aria-label="Email" placeholder="Email" style="width:100%;background:var(--bg);border:1px solid var(--border);border-radius:4px;padding:0.5rem 0.75rem;color:var(--fg);font-size:0.95em;font-family:inherit" value=""/></div><textarea required="" aria-label="Your comment" placeholder="" rows="5" style="width:100%;background:var(--bg);border:1px solid var(--border);border-radius:4px;padding:0.5rem 0.75rem;color:var(--fg);font-size:0.95em;font-family:inherit;resize:vertical;min-height:100px"></textarea><input tabindex="-1" autoComplete="off" aria-hidden="true" style="position:absolute;left:-9999px;opacity:0" name="website_url" value=""/><div style="display:flex;flex-wrap:wrap;align-items:center;gap:0.75rem 1rem"><div></div><span style="flex:1;min-width:1rem"></span><button type="submit" disabled="" style="background:var(--accent);border:none;border-radius:4px;padding:0.5rem 1.25rem;color:#0a0e1a;font-weight:600;cursor:pointer;opacity:0.6">Post comment</button></div></form></div></section></div><aside class="post-sidebar"><div class="ad-slot ad-slot--sidebar-top" data-ad-slot="sidebar-top" aria-label="Advertisement"><div class="ad-slot-inner"></div></div></aside></div></div><!--$--><!--/$--></main><div class="ad-slot ad-slot--footer-banner" data-ad-slot="footer-banner" aria-label="Advertisement"><div class="ad-slot-inner"></div></div><footer class="site-footer"><div class="site-footer-inner"><div class="site-footer-top"><div class="site-footer-brand"><a class="site-footer-logo" href="/"><img src="/logo.png" alt="" width="40" height="40"/><strong><span class="brandmark" aria-label="MSGANG.COM"><span class="brandmark-main">MSGANG</span><span class="brandmark-tld">.com</span></span></strong></a><p class="site-footer-tagline">Microsoft Software Products for FREE</p><div class="uptime-badge" role="status" aria-label="Service status: all systems operational"><span class="uptime-dot" aria-hidden="true"></span><span class="uptime-text">All systems operational</span><small>· 99.98% uptime</small></div></div><div class="site-footer-cols"><div class="site-footer-col"><h3>Products</h3><ul><li><a href="/category/microsoft-windows/">Windows</a></li><li><a href="/category/microsoft-office/">Office</a></li><li><a href="/category/windows-server/">Windows Server</a></li><li><a href="/category/windows-upgrade/">Windows Upgrade</a></li></ul></div><div class="site-footer-col"><h3>Explore</h3><ul><li><a href="/">Home</a></li><li><a href="/blog/">Blog</a></li><li><a href="/search/">Search</a></li><li><a href="/feed.xml">RSS feed</a></li></ul></div><div class="site-footer-col"><h3>Legal</h3><ul><li><a href="/privacy/">Privacy policy</a></li><li><a href="/terms/">Terms of service</a></li><li><a href="/contact/">Contact</a></li><li><a href="/sitemap.xml">Sitemap</a></li></ul></div></div></div><div class="site-footer-bottom"><div class="site-footer-copy">© 2026 MSGANG.COM. All rights reserved.<!-- --> · <a href="#" title="Re-open cookie consent banner">Cookie preferences</a></div><div class="site-footer-meta"></div></div></div></footer><button type="button" id="back-to-top" aria-label="Back to top" title="Back to top"><svg viewBox="0 0 24 24" width="17" height="17" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 19V5M6 11l6-6 6 6"></path></svg></button><a id="quick-edit" href="#" target="post-editor" rel="noopener" title="Edit in panel">✎ Edit</a><div data-custom="body-close"><!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-B88BXRWXGF"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-B88BXRWXGF'); </script></div><script src="/_next/static/chunks/webpack-9d6c75826dc26b20.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n3:I[9766,[],\"\"]\n4:I[8924,[],\"\"]\n6:I[4431,[],\"OutletBoundary\"]\n8:I[5278,[],\"AsyncMetadataOutlet\"]\na:I[4431,[],\"ViewportBoundary\"]\nc:I[4431,[],\"MetadataBoundary\"]\nd:\"$Sreact.suspense\"\nf:I[7150,[],\"\"]\n:HL[\"/_next/static/css/f7c4285cd0870d4d.css\",\"style\"]\n:HL[\"/_next/static/css/ad5ef9dbe117fb0b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"eQQ9Z57IZmTq7ko05RILT\",\"p\":\"\",\"c\":[\"\",\"how-to-create-a-batch-script-on-windows\",\"\"],\"i\":false,\"f\":[[[\"\",{\"children\":[[\"slug\",\"how-to-create-a-batch-script-on-windows\",\"d\"],{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/f7c4285cd0870d4d.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/ad5ef9dbe117fb0b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],\"$L2\"]}],{\"children\":[[\"slug\",\"how-to-create-a-batch-script-on-windows\",\"d\"],[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[\"$L5\",null,[\"$\",\"$L6\",null,{\"children\":[\"$L7\",[\"$\",\"$L8\",null,{\"promise\":\"$@9\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],null],[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$d\",null,{\"fallback\":null,\"children\":\"$Le\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$f\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"10:I[1402,[\"619\",\"static/chunks/619-ba102abea3e3d0e4.js\",\"177\",\"static/chunks/app/layout-f018c36ee1c32d7c.js\"],\"\"]\n11:I[8203,[\"619\",\"static/chunks/619-ba102abea3e3d0e4.js\",\"177\",\"static/chunks/app/layout-f018c36ee1c32d7c.js\"],\"default\"]\n12:I[5203,[\"619\",\"static/chunks/619-ba102abea3e3d0e4.js\",\"63\",\"static/chunks/63-2de52df045a7870e.js\",\"182\",\"static/chunks/app/%5Bslug%5D/page-f52076ffabd1b628.js\"],\"default\"]\n13:I[960,[\"619\",\"static/chunks/619-ba102abea3e3d0e4.js\",\"39\",\"static/chunks/app/error-24bc891c4a4fb364.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"2:[\"$\",\"html\",null,{\"lang\":\"en\",\"data-theme-variant\":\"classic\",\"data-ad-provider\":\"adsterra\",\"data-ads-hide-home\":\"\",\"suppressHydrationWarning\":true,\"children\":[\"\",[\"$\",\"body\",null,{\"children\":[[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"(function(){try{var t=localStorage.getItem('theme');if(!t)t=matchMedia('(prefers-color-scheme: light)').matches?'light':'dark';if(t==='light')document.documentElement.setAttribute('data-theme','light');}catch(e){}})();\"}}],\"\",[\"$\",\"$L10\",null,{\"id\":\"consent-mode-init\",\"strategy\":\"beforeInteractive\",\"children\":\"window.dataLayer=window.dataLayer||[];\\n function gtag(){dataLayer.push(arguments)}\\n gtag('consent','default',{\\n ad_storage:'granted',\\n ad_user_data:'granted',\\n ad_personalization:'granted',\\n analytics_storage:'granted',\\n wait_for_update:500\\n });\"}],[\"$\",\"a\",null,{\"href\":\"#main\",\"className\":\"skip-link\",\"children\":\"Skip to content\"}],[\"$\",\"script\",null,{\"type\":\"application/ld+json\",\"dangerouslySetInnerHTML\":{\"__html\":\"{\\\"@context\\\":\\\"https://schema.org\\\",\\\"@type\\\":\\\"Organization\\\",\\\"name\\\":\\\"MSGANG.COM\\\",\\\"url\\\":\\\"https://msgang.com\\\",\\\"logo\\\":\\\"https://msgang.com/logo.png\\\",\\\"founder\\\":{\\\"@type\\\":\\\"Person\\\",\\\"name\\\":\\\"MSGANG\\\"}}\"}}],[\"$\",\"$L11\",null,{\"hasContact\":false,\"items\":[{\"type\":\"link\",\"label\":\"Home\",\"href\":\"/\"},{\"type\":\"dropdown\",\"label\":\"Windows\",\"children\":[{\"label\":\"All Windows\",\"href\":\"/category/microsoft-windows\"},{\"label\":\"Windows 10\",\"href\":\"/category/windows-10\"},{\"label\":\"Windows 11\",\"href\":\"/category/windows-11\"},{\"label\":\"Windows 7\",\"href\":\"/category/windows-7\"},{\"label\":\"Windows 8\",\"href\":\"/category/windows-8\"},{\"label\":\"Windows LTSC\",\"href\":\"/category/windows-ltsc\"}]},{\"type\":\"dropdown\",\"label\":\"Office\",\"children\":[{\"label\":\"All Office\",\"href\":\"/category/microsoft-office\"},{\"label\":\"Office 2010\",\"href\":\"/category/office-2010\"},{\"label\":\"Office 2013\",\"href\":\"/category/office-2013\"},{\"label\":\"Office 2016\",\"href\":\"/category/office-2016\"},{\"label\":\"Office 2019\",\"href\":\"/category/office-2019\"},{\"label\":\"Office 2021\",\"href\":\"/category/office-2021\"},{\"label\":\"Office 2024\",\"href\":\"/category/office-2024\"}]},{\"type\":\"dropdown\",\"label\":\"Windows Server\",\"children\":[{\"label\":\"All Windows Server\",\"href\":\"/category/windows-server\"},{\"label\":\"Windows Server 2008\",\"href\":\"/category/windows-server-2008\"},{\"label\":\"Windows Server 2012\",\"href\":\"/category/windows-server-2012\"},{\"label\":\"Windows Server 2016\",\"href\":\"/category/windows-server-2016\"},{\"label\":\"Windows Server 2019\",\"href\":\"/category/windows-server-2019\"},{\"label\":\"Windows Server 2022\",\"href\":\"/category/windows-server-2022\"},{\"label\":\"Windows Server 2025\",\"href\":\"/category/windows-server-2025\"}]},{\"type\":\"dropdown\",\"label\":\"Windows Upgrade\",\"children\":[{\"label\":\"All Windows Upgrade\",\"href\":\"/category/windows-upgrade\"},{\"label\":\"Windows 10 Upgrade\",\"href\":\"/category/windows-10-upgrade\"},{\"label\":\"Windows 11 Upgrade\",\"href\":\"/category/windows-11-upgrade\"},{\"label\":\"Windows Server Upgrade\",\"href\":\"/category/windows-server-upgrade\"}]}]}],[\"$\",\"$L12\",null,{\"id\":\"header-banner\",\"html\":\"\u003cscript type=\\\"text/javascript\\\"\u003e\\n\\tatOptions = {\\n\\t\\t'key' : '9181700434aa2dd5895d168c7c12aafb',\\n\\t\\t'format' : 'iframe',\\n\\t\\t'height' : 90,\\n\\t\\t'width' : 728,\\n\\t\\t'params' : {}\\n\\t};\\n\u003c/script\u003e\\n\u003cscript type=\\\"text/javascript\\\" src=\\\"//www.highperformanceformat.com/9181700434aa2dd5895d168c7c12aafb/invoke.js\\\"\u003e\u003c/script\u003e\"}],[\"$\",\"main\",null,{\"id\":\"main\",\"className\":\"site-main\",\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$13\",\"errorStyles\":[],\"errorScripts\":[],\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"div\",null,{\"className\":\"container tight\",\"style\":{\"textAlign\":\"center\",\"padding\":\"5rem 1.5rem\"},\"children\":[[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"4rem\",\"fontWeight\":800,\"margin\":0,\"lineHeight\":1,\"color\":\"var(--accent)\"},\"children\":\"404\"}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"1.5rem\",\"fontWeight\":700,\"margin\":\"1rem 0 0.5rem\"},\"children\":\"Page not found\"}],[\"$\",\"p\",null,{\"style\":{\"color\":\"var(--muted)\",\"marginBottom\":\"2rem\"},\"children\":[\"The URL you requested doesn't exist on \",\"MSGANG.COM\",\". It may have been moved or removed.\"]}],\"$L14\"]}],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}],\"$L15\",\"$L16\",\"$L17\",false,\"$L18\",\"$L19\",\"$L1a\",false,false,false,\"$L1b\",\"$L1c\"]}]]}]\n"])</script><script>self.__next_f.push([1,"1d:I[2619,[\"619\",\"static/chunks/619-ba102abea3e3d0e4.js\",\"63\",\"static/chunks/63-2de52df045a7870e.js\",\"182\",\"static/chunks/app/%5Bslug%5D/page-f52076ffabd1b628.js\"],\"\"]\n1e:I[21,[\"619\",\"static/chunks/619-ba102abea3e3d0e4.js\",\"177\",\"static/chunks/app/layout-f018c36ee1c32d7c.js\"],\"default\"]\n1f:I[5067,[\"619\",\"static/chunks/619-ba102abea3e3d0e4.js\",\"177\",\"static/chunks/app/layout-f018c36ee1c32d7c.js\"],\"default\"]\n"])</script><script>self.__next_f.push([1,"14:[\"$\",\"div\",null,{\"style\":{\"display\":\"flex\",\"justifyContent\":\"center\",\"gap\":\"1rem\",\"flexWrap\":\"wrap\"},\"children\":[[\"$\",\"$L1d\",null,{\"href\":\"/\",\"style\":{\"background\":\"var(--accent)\",\"color\":\"var(--bg)\",\"padding\":\"0.6rem 1.25rem\",\"borderRadius\":4,\"fontWeight\":600,\"textDecoration\":\"none\"},\"children\":\"← Home\"}],[\"$\",\"$L1d\",null,{\"href\":\"/blog\",\"style\":{\"border\":\"1px solid var(--border)\",\"padding\":\"0.6rem 1.25rem\",\"borderRadius\":4,\"color\":\"var(--fg)\",\"textDecoration\":\"none\"},\"children\":\"Browse blog\"}],[\"$\",\"$L1d\",null,{\"href\":\"/search\",\"style\":{\"border\":\"1px solid var(--border)\",\"padding\":\"0.6rem 1.25rem\",\"borderRadius\":4,\"color\":\"var(--fg)\",\"textDecoration\":\"none\"},\"children\":\"Search\"}]]}]\n"])</script><script>self.__next_f.push([1,"15:[\"$\",\"$L12\",null,{\"id\":\"footer-banner\",\"html\":\"\u003cscript type=\\\"text/javascript\\\"\u003e\\n\\tatOptions = {\\n\\t\\t'key' : '9181700434aa2dd5895d168c7c12aafb',\\n\\t\\t'format' : 'iframe',\\n\\t\\t'height' : 90,\\n\\t\\t'width' : 728,\\n\\t\\t'params' : {}\\n\\t};\\n\u003c/script\u003e\\n\u003cscript type=\\\"text/javascript\\\" src=\\\"//www.highperformanceformat.com/9181700434aa2dd5895d168c7c12aafb/invoke.js\\\"\u003e\u003c/script\u003e\"}]\n"])</script><script>self.__next_f.push([1,"16:[\"$\",\"$L1e\",null,{\"hasContact\":false,\"footer\":{\"columns\":[{\"links\":[{\"href\":\"/category/microsoft-windows\",\"label\":\"Windows\"},{\"href\":\"/category/microsoft-office\",\"label\":\"Office\"},{\"href\":\"/category/windows-server\",\"label\":\"Windows Server\"},{\"href\":\"/category/windows-upgrade\",\"label\":\"Windows Upgrade\"}],\"title\":\"Products\"},{\"links\":[{\"href\":\"/\",\"label\":\"Home\"},{\"href\":\"/blog\",\"label\":\"Blog\"},{\"href\":\"/search\",\"label\":\"Search\"},{\"href\":\"/feed.xml\",\"label\":\"RSS feed\"}],\"title\":\"Explore\"},{\"links\":[{\"href\":\"/privacy\",\"label\":\"Privacy policy\"},{\"href\":\"/terms\",\"label\":\"Terms of service\"},{\"href\":\"/contact\",\"label\":\"Contact\"},{\"href\":\"/sitemap.xml\",\"label\":\"Sitemap\"}],\"title\":\"Legal\"}],\"social\":{},\"copyright\":\"\",\"show_powered_by\":false}}]\n"])</script><script>self.__next_f.push([1,"17:null\n18:[\"$\",\"$L1f\",null,{}]\n19:[\"$\",\"button\",null,{\"type\":\"button\",\"id\":\"back-to-top\",\"aria-label\":\"Back to top\",\"title\":\"Back to top\",\"children\":[\"$\",\"svg\",null,{\"viewBox\":\"0 0 24 24\",\"width\":\"17\",\"height\":\"17\",\"fill\":\"none\",\"stroke\":\"currentColor\",\"strokeWidth\":\"2.2\",\"strokeLinecap\":\"round\",\"strokeLinejoin\":\"round\",\"aria-hidden\":\"true\",\"children\":[\"$\",\"path\",null,{\"d\":\"M12 19V5M6 11l6-6 6 6\"}]}]}]\n1a:[\"$\",\"a\",null,{\"id\":\"quick-edit\",\"href\":\"#\",\"target\":\"post-editor\",\"rel\":\"noopener\",\"title\":\"Edit in panel\",\"children\":\"✎ Edit\"}]\n1b:[\"$\",\"div\",null,{\"data-custom\":\"body-close\",\"dangerouslySetInnerHTML\":{\"__html\":\"\u003c!-- Google tag (gtag.js) --\u003e\\n\u003cscript async src=\\\"https://www.googletagmanager.com/gtag/js?id=G-B88BXRWXGF\\\"\u003e\u003c/script\u003e\\n\u003cscript\u003e\\n window.dataLayer = window.dataLayer || [];\\n function gtag(){dataLayer.push(arguments);}\\n gtag('js', new Date());\\n\\n gtag('config', 'G-B88BXRWXGF');\\n\u003c/script\u003e\"}}]\n20:T1b9e,"])</script><script>self.__next_f.push([1,"document.addEventListener('click', function(e){\n var t = e.target;\n if (!t || !t.classList) return;\n // ── Copy ──\n if (t.classList.contains('code-copy')) {\n var block = t.closest('.code-block');\n if (!block) return;\n var code = block.querySelector('pre code');\n if (!code) return;\n var text = code.innerText.replace(/\\n$/, '');\n (navigator.clipboard ? navigator.clipboard.writeText(text)\n : new Promise(function(res){var ta=document.createElement('textarea');ta.value=text;document.body.appendChild(ta);ta.select();document.execCommand('copy');document.body.removeChild(ta);res();}))\n .then(function(){\n t.classList.add('copied');\n setTimeout(function(){t.classList.remove('copied')}, 1500);\n });\n return;\n }\n // ── Wrap toggle ──\n if (t.classList.contains('code-wrap')) {\n var wb = t.closest('.code-block');\n if (!wb) return;\n var w = wb.classList.toggle('wrap');\n t.classList.toggle('active', w);\n return;\n }\n // ── Expand / collapse ──\n if (t.classList.contains('code-expand')) {\n var b = t.closest('.code-block');\n if (!b) return;\n var on = b.classList.toggle('expanded');\n t.textContent = on ? '▲ Show less' : '▼ Show more';\n return;\n }\n // ── Fullscreen ──\n if (t.classList.contains('code-fullscreen')) {\n var src = t.closest('.code-block');\n if (!src) return;\n var clone = src.cloneNode(true);\n clone.classList.remove('tall', 'expanded');\n var fs = clone.querySelector('.code-fullscreen');\n if (fs) fs.remove();\n var exp = clone.querySelector('.code-expand');\n if (exp) exp.remove();\n var overlay = document.createElement('div');\n overlay.className = 'code-fullscreen-overlay';\n overlay.appendChild(clone);\n var close = document.createElement('button');\n close.type = 'button';\n close.className = 'code-fullscreen-close';\n close.setAttribute('aria-label', 'Close');\n close.textContent = '✕';\n overlay.appendChild(close);\n document.body.appendChild(overlay);\n document.body.style.overflow = 'hidden';\n return;\n }\n // ── Close fullscreen ──\n if (t.classList.contains('code-fullscreen-close') ||\n (t.classList.contains('code-fullscreen-overlay') \u0026\u0026 t === e.target)) {\n var ov = t.classList.contains('code-fullscreen-overlay') ? t : t.closest('.code-fullscreen-overlay');\n if (ov) { ov.remove(); document.body.style.overflow = ''; }\n return;\n }\n });\n // Escape closes fullscreen\n document.addEventListener('keydown', function(e){\n if (e.key !== 'Escape') return;\n var ov = document.querySelector('.code-fullscreen-overlay');\n if (ov) { ov.remove(); document.body.style.overflow = ''; }\n });\n // Detect \"tall\" code blocks + inject the expand button\n function tagTallCodeBlocks(){\n document.querySelectorAll('.code-block').forEach(function(b){\n if (b.dataset.tallChecked) return;\n b.dataset.tallChecked = '1';\n // Reflect the default-wrap class onto the wrap button.\n if (b.classList.contains('wrap')) {\n var wb = b.querySelector('.code-wrap');\n if (wb) wb.classList.add('active');\n }\n var pre = b.querySelector('pre');\n if (!pre) return;\n if (pre.scrollHeight \u003e 480) {\n b.classList.add('tall');\n if (!b.querySelector('.code-expand')) {\n var btn = document.createElement('button');\n btn.type = 'button';\n btn.className = 'code-expand';\n btn.textContent = '▼ Show more';\n b.appendChild(btn);\n }\n }\n });\n }\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', tagTallCodeBlocks);\n } else {\n tagTallCodeBlocks();\n }\n // Back-to-top button — fade in past 100vh, click to scroll.\n (function(){\n var btn = document.getElementById('back-to-top');\n if (!btn) return;\n btn.addEventListener('click', function(){\n window.scrollTo({ top: 0, behavior: 'smooth' });\n });\n function update(){\n if (window.scrollY \u003e window.innerHeight) btn.classList.add('show');\n else btn.classList.remove('show');\n }\n window.addEventListener('scroll', update, { passive: true });\n update();\n })();\n // Quick-edit FAB — only show for admin (localStorage flag).\n // First-time enable: load any site page with ?edit=1.\n (function(){\n var qe = document.getElementById('quick-edit');\n if (!qe) return;\n try {\n var url = new URL(window.location.href);\n if (url.searchParams.get('edit') === '1') {\n localStorage.setItem('panelEdit', '1');\n } else if (url.searchParams.get('edit') === '0') {\n localStorage.removeItem('panelEdit');\n }\n } catch(e) {}\n if (localStorage.getItem('panelEdit') !== '1') return;\n // Split path manually — JSX template literals mangle regex\n // backslash escapes, so a literal /^/blog/.../ won't survive.\n var parts = location.pathname.split('/').filter(Boolean);\n var href = 'https://panel.lab.winget.tech/sites/' + location.host;\n // Built-in routes that have no markdown source — FAB lands on\n // the pages list with a hint rather than the (now-redirected)\n // edit URL.\n var NON_EDITABLE = ['contact','search','tags','category','sitemap.xml','robots.txt','feed.xml','ads.txt'];\n if (parts.length === 0) {\n href += '/pages/home/edit'; // homepage\n } else if (parts.length === 2 \u0026\u0026 parts[0] === 'blog') {\n href += '/posts/' + parts[1] + '/edit'; // post\n } else if (parts.length === 1 \u0026\u0026 NON_EDITABLE.indexOf(parts[0]) \u003c 0) {\n href += '/pages/' + parts[0] + '/edit'; // top-level page\n } else {\n href += '/pages';\n }\n qe.href = href;\n qe.classList.add('show');\n })();"])</script><script>self.__next_f.push([1,"1c:[\"$\",\"$L10\",null,{\"id\":\"code-copy-init\",\"strategy\":\"afterInteractive\",\"children\":\"$20\"}]\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"2\",{\"name\":\"theme-color\",\"content\":\"#0a0e1a\"}]]\n7:null\n"])</script><script>self.__next_f.push([1,"21:I[6499,[\"619\",\"static/chunks/619-ba102abea3e3d0e4.js\",\"63\",\"static/chunks/63-2de52df045a7870e.js\",\"182\",\"static/chunks/app/%5Bslug%5D/page-f52076ffabd1b628.js\"],\"default\"]\n22:T419e,"])</script><script>self.__next_f.push([1,"\u003cp\u003eBatch files are a handy way to automate everyday tasks, make processes more efficient, and turn complicated operations into simple, user-friendly actions that anyone can run.\u003c/p\u003e\n\u003cp\u003eIn 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.\u003c/p\u003e\n\u003ch3\u003eHow to Create a Batch File on Windows\u003c/h3\u003e\n\u003cp\u003eTo create a Windows batch file, follow these steps:\u003c/p\u003e\u003cdiv class=\"ad-slot ad-slot--in-article-2\" data-ad-slot=\"in-article-2\" data-ad-lazy=\"PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPgoJYXRPcHRpb25zID0gewoJCSdrZXknIDogJzkxODE3MDA0MzRhYTJkZDU4OTVkMTY4YzdjMTJhYWZiJywKCQknZm9ybWF0JyA6ICdpZnJhbWUnLAoJCSdoZWlnaHQnIDogOTAsCgkJJ3dpZHRoJyA6IDcyOCwKCQkncGFyYW1zJyA6IHt9Cgl9Owo8L3NjcmlwdD4KPHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiIHNyYz0iLy93d3cuaGlnaHBlcmZvcm1hbmNlZm9ybWF0LmNvbS85MTgxNzAwNDM0YWEyZGQ1ODk1ZDE2OGM3YzEyYWFmYi9pbnZva2UuanMiPjwvc2NyaXB0Pg==\" aria-label=\"Advertisement\"\u003e\u003cdiv class=\"ad-slot-inner\"\u003e\u003c/div\u003e\u003c/div\u003e\n\u003cp\u003e1. Open or create a new text file using \u003cstrong\u003eNotepad\u003c/strong\u003e or \u003cstrong\u003eWordPad document\u003c/strong\u003e or any text editor**.**\u003c/p\u003e\n\u003cp\u003e\u003cpicture\u003e\n \u003csource type=\"image/webp\" srcset=\"/uploads/674e1717f684-320w.webp 320w, /uploads/674e1717f684-640w.webp 640w, /uploads/674e1717f684.webp 768w\" sizes=\"(max-width: 860px) 100vw, 860px\"\u003e\n \u003cimg src=\"/uploads/674e1717f684.png\" srcset=\"/uploads/674e1717f684-320w.png 320w, /uploads/674e1717f684-640w.png 640w, /uploads/674e1717f684.png 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" alt=\"Bg2124.png\" width=\"768\" height=\"346\" loading=\"lazy\" decoding=\"async\"\u003e\n\u003c/picture\u003e\u003c/p\u003e\n\u003cp\u003e2. Add your commands:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003e@echo off\u003c/strong\u003e : 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.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003etitle This is your first batch script\u003c/strong\u003e: Providing much of the same function as a \u003ctitle\u003e tag in HTML, this will provide a title for your batch script in your Command Prompt window.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eecho Welcome to batch scripting\u003c/strong\u003e: Print “Welcome to batch scripting**”** \u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003epause\u003c/strong\u003e: 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.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"code-block\" data-lang=\"bash\"\u003e\n \u003cdiv class=\"code-block-head\"\u003e\n \n \u003cspan class=\"code-block-lang\"\u003ebash\u003c/span\u003e\n \u003cbutton type=\"button\" class=\"code-wrap\" aria-label=\"Toggle line wrap\" title=\"Wrap long lines\"\u003e↵\u003c/button\u003e\n \u003cbutton type=\"button\" class=\"code-fullscreen\" aria-label=\"View fullscreen\" title=\"Fullscreen\"\u003e⛶\u003c/button\u003e\n \u003cbutton type=\"button\" class=\"code-copy\" aria-label=\"Copy code\"\u003e\u003c/button\u003e\n \u003c/div\u003e\n \u003cpre class=\"shiki\" style=\"background-color:#282c34;color:#abb2bf\"\u003e\u003ccode\u003e\u003cspan class=\"code-line\" data-line=\"1\"\u003e\u003cspan style=\"color:#61AFEF\"\u003e@echo\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e off\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"code-line\" data-line=\"2\"\u003e\u003cspan style=\"color:#61AFEF\"\u003etitle\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e This\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e is\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e your\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e first\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e batch\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e script.\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"code-line\" data-line=\"3\"\u003e\u003cspan style=\"color:#56B6C2\"\u003eecho\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e Welcome\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e to\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e batch\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e scripting.\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"code-line\" data-line=\"4\"\u003e\u003cspan style=\"color:#61AFEF\"\u003epause\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\u003cp\u003e\u003cpicture\u003e\n \u003csource type=\"image/webp\" srcset=\"/uploads/83fd36b42cf7-320w.webp 320w, /uploads/83fd36b42cf7-640w.webp 640w, /uploads/83fd36b42cf7.webp 768w\" sizes=\"(max-width: 860px) 100vw, 860px\"\u003e\n \u003cimg src=\"/uploads/83fd36b42cf7.png\" srcset=\"/uploads/83fd36b42cf7-320w.png 320w, /uploads/83fd36b42cf7-640w.png 640w, /uploads/83fd36b42cf7.png 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" alt=\"Bg2121.png\" width=\"768\" height=\"188\" loading=\"lazy\" decoding=\"async\"\u003e\n\u003c/picture\u003e\u003c/p\u003e\n\u003cp\u003e3. Next, save your text file with the \u003cstrong\u003e.bat\u003c/strong\u003e file extension by navigating to the File menu and selecting \u003cstrong\u003eSave As..\u003c/strong\u003e. option.\u003c/p\u003e\n\u003cp\u003e\u003cpicture\u003e\n \u003csource type=\"image/webp\" srcset=\"/uploads/1aeb1e261568-320w.webp 320w, /uploads/1aeb1e261568-640w.webp 640w, /uploads/1aeb1e261568.webp 768w\" sizes=\"(max-width: 860px) 100vw, 860px\"\u003e\n \u003cimg src=\"/uploads/1aeb1e261568.png\" srcset=\"/uploads/1aeb1e261568-320w.png 320w, /uploads/1aeb1e261568-640w.png 640w, /uploads/1aeb1e261568.png 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" alt=\"Bg2122.png\" width=\"768\" height=\"276\" loading=\"lazy\" decoding=\"async\"\u003e\n\u003c/picture\u003e\u003c/p\u003e\n\u003cp\u003e4. In the Save As window:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eChange \u003cstrong\u003eSave as type\u003c/strong\u003e to \u003cstrong\u003eAll Files\u003c/strong\u003e\u003c/li\u003e\n\u003cli\u003eThen type a filename with \u003cstrong\u003e.bat\u003c/strong\u003e as the file extension.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003cpicture\u003e\n \u003csource type=\"image/webp\" srcset=\"/uploads/2db1ad1c7c5e-320w.webp 320w, /uploads/2db1ad1c7c5e-640w.webp 640w, /uploads/2db1ad1c7c5e.webp 768w\" sizes=\"(max-width: 860px) 100vw, 860px\"\u003e\n \u003cimg src=\"/uploads/2db1ad1c7c5e.png\" srcset=\"/uploads/2db1ad1c7c5e-320w.png 320w, /uploads/2db1ad1c7c5e-640w.png 640w, /uploads/2db1ad1c7c5e.png 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" alt=\"Bg2123.png\" width=\"768\" height=\"368\" loading=\"lazy\" decoding=\"async\"\u003e\n\u003c/picture\u003e\u003c/p\u003e\n\u003cp\u003e5. Now, \u003cstrong\u003edouble-click\u003c/strong\u003e on your newly created batch file to run it.\u003c/p\u003e\n\u003cp\u003e\u003cpicture\u003e\n \u003csource type=\"image/webp\" srcset=\"/uploads/3b9bfdb24a64-320w.webp 320w, /uploads/3b9bfdb24a64-640w.webp 640w, /uploads/3b9bfdb24a64.webp 768w\" sizes=\"(max-width: 860px) 100vw, 860px\"\u003e\n \u003cimg src=\"/uploads/3b9bfdb24a64.png\" srcset=\"/uploads/3b9bfdb24a64-320w.png 320w, /uploads/3b9bfdb24a64-640w.png 640w, /uploads/3b9bfdb24a64.png 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" alt=\"Bg2125.png\" width=\"768\" height=\"405\" loading=\"lazy\" decoding=\"async\"\u003e\n\u003c/picture\u003e\u003c/p\u003e\n\u003cp\u003eAnd here’s the corresponding command window for the example above:\u003c/p\u003e\n\u003cp\u003e\u003cpicture\u003e\n \u003csource type=\"image/webp\" srcset=\"/uploads/cd106a075240-320w.webp 320w, /uploads/cd106a075240-640w.webp 640w, /uploads/cd106a075240.webp 768w\" sizes=\"(max-width: 860px) 100vw, 860px\"\u003e\n \u003cimg src=\"/uploads/cd106a075240.png\" srcset=\"/uploads/cd106a075240-320w.png 320w, /uploads/cd106a075240-640w.png 640w, /uploads/cd106a075240.png 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" alt=\"Bg2126.png\" width=\"768\" height=\"194\" loading=\"lazy\" decoding=\"async\"\u003e\n\u003c/picture\u003e\u003c/p\u003e\n\u003cp\u003e6. To edit the batch script, let’s right click on it then select \u003cstrong\u003eEdit\u003c/strong\u003e.\u003c/p\u003e\n\u003ch3\u003eBasics of Batch Scripting\u003c/h3\u003e\n\u003cp\u003eBatch 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.\u003c/p\u003e\n\u003cp\u003eMore basic parameters for batch scripting:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003ecls\u003c/strong\u003e: Clears your command prompt, best used when extraneous code can make what you’re accessing had to find.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003erem\u003c/strong\u003e: Shorthand for remark provides the same functionality as \u0026lt;!– tag in HTML. Rem statements are not entered into your code. Instead, they are used to explain and give information regarding the code.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e%%a\u003c/strong\u003e: Each file in the folder.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e(“.\\”)\u003c/strong\u003e: 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.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThe library for batch variables is huge, to say the least. Luckily there is a \u003ca href=\"https://en.wikibooks.org/wiki/Windows_Batch_Scripting\" target=\"_blank\" rel=\"noopener noreferrer\"\u003eWikibook entry\u003c/a\u003e that holds the extensive library of batch script parameters and variables at your disposal.\u003c/p\u003e\n\u003ch3\u003eExamples of batch scripts\u003c/h3\u003e\n\u003cp\u003eIn this section, we’ll create examples of batch scripts designed to streamline and simplify your daily online and offline tasks.\u003c/p\u003e\n\u003ch3\u003e\u003ca href=\"https://bonguides.com/how-to-open-multiple-urls-in-a-browser-using-a-batch-file/\" target=\"_blank\" rel=\"noopener noreferrer\"\u003eBatch file to open websites\u003c/a\u003e\u003c/h3\u003e\n\u003cp\u003eThe script below uses multiple \u003cstrong\u003estart “”\u003c/strong\u003e parameters to open several websites in separate tabs through a batch file. Simply replace the provided links with your desired URLs.\u003c/p\u003e\n\u003cdiv class=\"code-block\" data-lang=\"bash\"\u003e\n \u003cdiv class=\"code-block-head\"\u003e\n \n \u003cspan class=\"code-block-lang\"\u003ebash\u003c/span\u003e\n \u003cbutton type=\"button\" class=\"code-wrap\" aria-label=\"Toggle line wrap\" title=\"Wrap long lines\"\u003e↵\u003c/button\u003e\n \u003cbutton type=\"button\" class=\"code-fullscreen\" aria-label=\"View fullscreen\" title=\"Fullscreen\"\u003e⛶\u003c/button\u003e\n \u003cbutton type=\"button\" class=\"code-copy\" aria-label=\"Copy code\"\u003e\u003c/button\u003e\n \u003c/div\u003e\n \u003cpre class=\"shiki\" style=\"background-color:#282c34;color:#abb2bf\"\u003e\u003ccode\u003e\u003cspan class=\"code-line\" data-line=\"1\"\u003e\u003cspan style=\"color:#61AFEF\"\u003e@echo\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e off\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"code-line\" data-line=\"2\"\u003e\u003cspan style=\"color:#61AFEF\"\u003estart\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e \"\"\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e http://www.bbc.com\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"code-line\" data-line=\"3\"\u003e\u003cspan style=\"color:#61AFEF\"\u003estart\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e \"\"\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e https://google.com/\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"code-line\" data-line=\"4\"\u003e\u003cspan style=\"color:#61AFEF\"\u003estart\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e \"\"\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e https://bonguides.com/\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\u003cp\u003eNote \u003cstrong\u003eNote:\u003c/strong\u003e Without the pause parameter, the batch file will close automatically after executing the last command.\n\u003cpicture\u003e\n \u003csource type=\"image/webp\" srcset=\"/uploads/28d35699cc89-320w.webp 320w, /uploads/28d35699cc89-640w.webp 640w, /uploads/28d35699cc89.webp 768w\" sizes=\"(max-width: 860px) 100vw, 860px\"\u003e\n \u003cimg src=\"/uploads/28d35699cc89.png\" srcset=\"/uploads/28d35699cc89-320w.png 320w, /uploads/28d35699cc89-640w.png 640w, /uploads/28d35699cc89.png 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" alt=\"Bg2127.png\" width=\"768\" height=\"224\" loading=\"lazy\" decoding=\"async\"\u003e\n\u003c/picture\u003e\u003c/p\u003e\n\u003ch3\u003eBatch file that opens multiple programs\u003c/h3\u003e\n\u003cp\u003eIf 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.\u003c/p\u003e\n\u003cp\u003eAll 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:\u003c/p\u003e\n\u003cdiv class=\"code-block\" data-lang=\"bash\"\u003e\n \u003cdiv class=\"code-block-head\"\u003e\n \n \u003cspan class=\"code-block-lang\"\u003ebash\u003c/span\u003e\n \u003cbutton type=\"button\" class=\"code-wrap\" aria-label=\"Toggle line wrap\" title=\"Wrap long lines\"\u003e↵\u003c/button\u003e\n \u003cbutton type=\"button\" class=\"code-fullscreen\" aria-label=\"View fullscreen\" title=\"Fullscreen\"\u003e⛶\u003c/button\u003e\n \u003cbutton type=\"button\" class=\"code-copy\" aria-label=\"Copy code\"\u003e\u003c/button\u003e\n \u003c/div\u003e\n \u003cpre class=\"shiki\" style=\"background-color:#282c34;color:#abb2bf\"\u003e\u003ccode\u003e\u003cspan class=\"code-line\" data-line=\"1\"\u003e\u003cspan style=\"color:#61AFEF\"\u003e@echo\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e off\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"code-line\" data-line=\"2\"\u003e\u003cspan style=\"color:#56B6C2\"\u003ecd\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e \"C:\\Program Files\\Microsoft Office\\root\\Office16\u003c/span\u003e\u003cspan style=\"color:#56B6C2\"\u003e\\\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"code-line\" data-line=\"3\"\u003e\u003cspan style=\"color:#98C379\"\u003estart excel.exe\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"code-line\" data-line=\"4\"\u003e\u003c/span\u003e\u003cspan class=\"code-line\" data-line=\"5\"\u003e\u003cspan style=\"color:#98C379\"\u003estart calc.exe\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"code-line\" data-line=\"6\"\u003e\u003c/span\u003e\u003cspan class=\"code-line\" data-line=\"7\"\u003e\u003cspan style=\"color:#98C379\"\u003ecd \"C:\u003c/span\u003e\u003cspan style=\"color:#56B6C2\"\u003e\\P\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003erogram\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e Files\u003c/span\u003e\u003cspan style=\"color:#ABB2BF\"\u003e (x86)\u003c/span\u003e\u003cspan style=\"color:#56B6C2\"\u003e\\M\u003c/span\u003e\u003cspan style=\"color:#ABB2BF\"\u003eicrosoft\u003c/span\u003e\u003cspan style=\"color:#56B6C2\"\u003e\\E\u003c/span\u003e\u003cspan style=\"color:#ABB2BF\"\u003edge\u003c/span\u003e\u003cspan style=\"color:#56B6C2\"\u003e\\A\u003c/span\u003e\u003cspan style=\"color:#ABB2BF\"\u003epplication\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"code-line\" data-line=\"8\"\u003e\u003cspan style=\"color:#98C379\"\u003estart msedge.exe\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\u003cp\u003e\u003cpicture\u003e\n \u003csource type=\"image/webp\" srcset=\"/uploads/fa1146fc9a9c-320w.webp 320w, /uploads/fa1146fc9a9c-640w.webp 640w, /uploads/fa1146fc9a9c.webp 768w\" sizes=\"(max-width: 860px) 100vw, 860px\"\u003e\n \u003cimg src=\"/uploads/fa1146fc9a9c.png\" srcset=\"/uploads/fa1146fc9a9c-320w.png 320w, /uploads/fa1146fc9a9c-640w.png 640w, /uploads/fa1146fc9a9c.png 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" alt=\"Bg2128.png\" width=\"768\" height=\"178\" loading=\"lazy\" decoding=\"async\"\u003e\n\u003c/picture\u003e\u003c/p\u003e\n\u003ch3\u003eBatch file to restart your computer\u003c/h3\u003e\n\u003cp\u003eThe below script will restart your computer after 5 seconds.\u003c/p\u003e\n\u003cdiv class=\"code-block\" data-lang=\"bash\"\u003e\n \u003cdiv class=\"code-block-head\"\u003e\n \n \u003cspan class=\"code-block-lang\"\u003ebash\u003c/span\u003e\n \u003cbutton type=\"button\" class=\"code-wrap\" aria-label=\"Toggle line wrap\" title=\"Wrap long lines\"\u003e↵\u003c/button\u003e\n \u003cbutton type=\"button\" class=\"code-fullscreen\" aria-label=\"View fullscreen\" title=\"Fullscreen\"\u003e⛶\u003c/button\u003e\n \u003cbutton type=\"button\" class=\"code-copy\" aria-label=\"Copy code\"\u003e\u003c/button\u003e\n \u003c/div\u003e\n \u003cpre class=\"shiki\" style=\"background-color:#282c34;color:#abb2bf\"\u003e\u003ccode\u003e\u003cspan class=\"code-line\" data-line=\"1\"\u003e\u003cspan style=\"color:#61AFEF\"\u003e@echo\u003c/span\u003e\u003cspan style=\"color:#98C379\"\u003e off\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"code-line\" data-line=\"2\"\u003e\u003cspan style=\"color:#61AFEF\"\u003eshutdown\u003c/span\u003e\u003cspan style=\"color:#D19A66\"\u003e -r\u003c/span\u003e\u003cspan style=\"color:#D19A66\"\u003e -t\u003c/span\u003e\u003cspan style=\"color:#D19A66\"\u003e 5\u003c/span\u003e\u003c/span\u003e\u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\u003cp\u003e\u003cpicture\u003e\n \u003csource type=\"image/webp\" srcset=\"/uploads/c8f3ec5f1b0c-320w.webp 320w, /uploads/c8f3ec5f1b0c-640w.webp 640w, /uploads/c8f3ec5f1b0c.webp 768w\" sizes=\"(max-width: 860px) 100vw, 860px\"\u003e\n \u003cimg src=\"/uploads/c8f3ec5f1b0c.png\" srcset=\"/uploads/c8f3ec5f1b0c-320w.png 320w, /uploads/c8f3ec5f1b0c-640w.png 640w, /uploads/c8f3ec5f1b0c.png 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" alt=\"Bg2129.png\" width=\"768\" height=\"244\" loading=\"lazy\" decoding=\"async\"\u003e\n\u003c/picture\u003e\u003c/p\u003e\n\u003cdiv class=\"info-card info-card--note\"\u003e\u003ch3\u003eConclusion\u003c/h3\u003e\n\u003cp\u003eHello Friends! My name is Leo, and I’m excited to share everything I know about activating Microsoft software products. In the past, I managed several YouTube channels on this topic, but they were taken down by Microsoft. That’s why I decided to start this blog to keep the conversation alive without interruptions. I’m committed to sharing my knowledge and insights for as long as possible!\u003c/p\u003e\n\u003cp\u003eIf you have any questions or concerns, feel free to leave a comment or visit my \u003ca href=\"https://discord.gg/kNZs7Wwvgb\" target=\"_blank\" rel=\"noopener noreferrer\"\u003eDiscord server\u003c/a\u003e. I’d be happy to provide more details. Thank you so much for your feedback and support!\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"https://ko-fi.com/msgang\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cpicture\u003e\n \u003csource type=\"image/webp\" srcset=\"/uploads/a17abe6216f8-320w.webp 320w, /uploads/a17abe6216f8-640w.webp 640w, /uploads/a17abe6216f8.webp 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\"\u003e\n \u003cimg src=\"/uploads/a17abe6216f8.png\" srcset=\"/uploads/a17abe6216f8-320w.png 320w, /uploads/a17abe6216f8-640w.png 640w, /uploads/a17abe6216f8.png 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" alt=\"Buy Me A Coffee\" width=\"1024\" height=\"287\" loading=\"lazy\" decoding=\"async\"\u003e\n\u003c/picture\u003e\u003c/a\u003e\u003c/p\u003e\n\u003c/div\u003e\u003cdiv class=\"info-card info-card--links\"\u003e\u003cp\u003eWant to activate others Microsoft products for free? You can follow the below posts:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"/category/microsoft-windows/\" rel=\"noopener noreferrer\" target=\"_blank\"\u003eWindows 7/8/8.1/10/11\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"/category/windows-server/\" title=\"/how-to-activate-all-windows-editions-for-free/\" rel=\"noopener noreferrer\" target=\"_blank\"\u003eWindows Servers 2008/2012/2016/2019/2022\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"/category/microsoft-office/\" rel=\"noopener noreferrer\" target=\"_blank\"\u003eMicrosoft Office 2013/2016/2019/2021 (included Visio and Project)\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003c/div\u003e\n"])</script><script>self.__next_f.push([1,"5:[[\"$\",\"script\",null,{\"type\":\"application/ld+json\",\"dangerouslySetInnerHTML\":{\"__html\":\"{\\\"@context\\\":\\\"https://schema.org\\\",\\\"@type\\\":\\\"Article\\\",\\\"headline\\\":\\\"How To Create A Batch Script On Windows\\\",\\\"description\\\":\\\"Batch files are the computer handyman's way of getting things done. They can automate everyday tasks, shorten the required time to do something, and translate…\\\",\\\"datePublished\\\":\\\"2025-03-17T23:37:01.000Z\\\",\\\"dateModified\\\":\\\"2026-06-03T14:29:29.079Z\\\",\\\"author\\\":{\\\"@type\\\":\\\"Organization\\\",\\\"name\\\":\\\"MSGANG.COM\\\"},\\\"publisher\\\":{\\\"@type\\\":\\\"Organization\\\",\\\"name\\\":\\\"MSGANG.COM\\\",\\\"logo\\\":{\\\"@type\\\":\\\"ImageObject\\\",\\\"url\\\":\\\"https://msgang.com/logo.png\\\"}},\\\"image\\\":[\\\"https://msgang.com/uploads/b0ea6b16a201.png\\\"],\\\"mainEntityOfPage\\\":{\\\"@type\\\":\\\"WebPage\\\",\\\"@id\\\":\\\"https://msgang.com/how-to-create-a-batch-script-on-windows/\\\"},\\\"articleSection\\\":\\\"2025\\\"}\"}}],[\"$\",\"script\",null,{\"type\":\"application/ld+json\",\"dangerouslySetInnerHTML\":{\"__html\":\"{\\\"@context\\\":\\\"https://schema.org\\\",\\\"@type\\\":\\\"BreadcrumbList\\\",\\\"itemListElement\\\":[{\\\"@type\\\":\\\"ListItem\\\",\\\"position\\\":1,\\\"name\\\":\\\"Home\\\",\\\"item\\\":\\\"https://msgang.com\\\"},{\\\"@type\\\":\\\"ListItem\\\",\\\"position\\\":2,\\\"name\\\":\\\"2025\\\",\\\"item\\\":\\\"https://msgang.com/category/2025/\\\"},{\\\"@type\\\":\\\"ListItem\\\",\\\"position\\\":3,\\\"name\\\":\\\"How To Create A Batch Script On Windows\\\",\\\"item\\\":\\\"https://msgang.com/how-to-create-a-batch-script-on-windows/\\\"}]}\"}}],[\"$\",\"div\",null,{\"className\":\"container wide\",\"children\":[[\"$\",\"div\",null,{\"className\":\"post-with-toc\",\"children\":[[\"$\",\"div\",null,{\"children\":[[\"$\",\"article\",null,{\"className\":\"post-article\",\"style\":{\"--hue\":116},\"children\":[[\"$\",\"nav\",null,{\"className\":\"archive-crumbs\",\"aria-label\":\"Breadcrumb\",\"children\":[[\"$\",\"$L1d\",null,{\"href\":\"/\",\"children\":\"Home\"}],[\"$\",\"span\",null,{\"aria-hidden\":true,\"children\":\"/\"}],[[\"$\",\"$L1d\",null,{\"href\":\"/category/2025\",\"children\":\"2025\"}],[\"$\",\"span\",null,{\"aria-hidden\":true,\"children\":\"/\"}]],[\"$\",\"span\",null,{\"className\":\"archive-crumbs-cur\",\"children\":\"How To Create A Batch Script On Windows\"}]]}],[\"$\",\"header\",null,{\"className\":\"post-head\",\"children\":[[\"$\",\"h1\",null,{\"className\":\"post-title\",\"children\":\"How To Create A Batch Script On Windows\"}],[\"$\",\"div\",null,{\"className\":\"post-head-meta\",\"children\":[\"$undefined\",\"$undefined\",[\"$\",\"time\",null,{\"dateTime\":\"2025-03-17T23:37:01.000Z\",\"children\":\"Mar 17, 2025\"}],[[\"$\",\"span\",null,{\"className\":\"post-head-dot\",\"aria-hidden\":true,\"children\":\"·\"}],[\"$\",\"span\",null,{\"children\":[\"Updated \",\"Jun 3, 2026\"]}]],[\"$\",\"span\",null,{\"className\":\"post-head-dot\",\"aria-hidden\":true,\"children\":\"·\"}],[\"$\",\"span\",null,{\"children\":[4,\" min read\"]}]]}]]}],[\"$\",\"$L21\",null,{\"variant\":\"inline\"}],[\"$\",\"div\",null,{\"className\":\"post-body\",\"dangerouslySetInnerHTML\":{\"__html\":\"$22\"}}],false]}],\"$L23\",\"$L24\"]}],\"$L25\"]}],\"$L26\"]}]]\n"])</script><script>self.__next_f.push([1,"27:I[6434,[\"619\",\"static/chunks/619-ba102abea3e3d0e4.js\",\"63\",\"static/chunks/63-2de52df045a7870e.js\",\"182\",\"static/chunks/app/%5Bslug%5D/page-f52076ffabd1b628.js\"],\"default\"]\n28:I[8699,[\"619\",\"static/chunks/619-ba102abea3e3d0e4.js\",\"63\",\"static/chunks/63-2de52df045a7870e.js\",\"182\",\"static/chunks/app/%5Bslug%5D/page-f52076ffabd1b628.js\"],\"default\"]\n29:I[2718,[\"619\",\"static/chunks/619-ba102abea3e3d0e4.js\",\"63\",\"static/chunks/63-2de52df045a7870e.js\",\"182\",\"static/chunks/app/%5Bslug%5D/page-f52076ffabd1b628.js\"],\"default\"]\n2a:I[622,[],\"IconMark\"]\n23:[\"$\",\"$L27\",null,{\"postSlug\":\"how-to-create-a-batch-script-on-windows\"}]\n24:[\"$\",\"$L28\",null,{\"postSlug\":\"how-to-create-a-batch-script-on-windows\"}]\n25:[\"$\",\"aside\",null,{\"className\":\"post-sidebar\",\"children\":[[\"$\",\"$L12\",null,{\"id\":\"sidebar-top\",\"html\":\"\u003cscript type=\\\"text/javascript\\\"\u003e\\n\\tatOptions = {\\n\\t\\t'key' : '288cd98514ad96d7f8f40a15cc50d615',\\n\\t\\t'format' : 'iframe',\\n\\t\\t'height' : 250,\\n\\t\\t'width' : 300,\\n\\t\\t'params' : {}\\n\\t};\\n\u003c/script\u003e\\n\u003cscript type=\\\"text/javascript\\\" src=\\\"//www.highperformanceformat.com/288cd98514ad96d7f8f40a15cc50d615/invoke.js\\\"\u003e\u003c/script\u003e\"}],null]}]\n26:[\"$\",\"$L29\",null,{}]\n"])</script><script>self.__next_f.push([1,"9:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"How To Create A Batch Script On Windows — MSGANG.COM\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Batch files are the computer handyman's way of getting things done. They can automate everyday tasks, shorten the required time to do something, and translate a complex process into something anyone could operate.\"}],[\"$\",\"meta\",\"2\",{\"name\":\"application-name\",\"content\":\"MSGANG.COM\"}],[\"$\",\"link\",\"3\",{\"rel\":\"manifest\",\"href\":\"/site.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"4\",{\"rel\":\"canonical\",\"href\":\"https://msgang.com/how-to-create-a-batch-script-on-windows/\"}],[\"$\",\"meta\",\"5\",{\"property\":\"og:title\",\"content\":\"How To Create A Batch Script On Windows\"}],[\"$\",\"meta\",\"6\",{\"property\":\"og:description\",\"content\":\"Batch files are the computer handyman's way of getting things done. They can automate everyday tasks, shorten the required time to do something, and translate a complex process into something anyone could operate.\"}],[\"$\",\"meta\",\"7\",{\"property\":\"og:url\",\"content\":\"https://msgang.com/how-to-create-a-batch-script-on-windows/\"}],[\"$\",\"meta\",\"8\",{\"property\":\"og:image\",\"content\":\"https://msgang.com/uploads/b0ea6b16a201.png\"}],[\"$\",\"meta\",\"9\",{\"property\":\"og:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"10\",{\"property\":\"og:image:height\",\"content\":\"630\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:image:alt\",\"content\":\"How To Create A Batch Script On Windows\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:type\",\"content\":\"article\"}],[\"$\",\"meta\",\"13\",{\"property\":\"article:published_time\",\"content\":\"2025-03-17T23:37:01.000Z\"}],[\"$\",\"meta\",\"14\",{\"property\":\"article:modified_time\",\"content\":\"2026-06-03T14:29:29.079Z\"}],[\"$\",\"meta\",\"15\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"16\",{\"name\":\"twitter:title\",\"content\":\"How To Create A Batch Script On Windows\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:description\",\"content\":\"Batch files are the computer handyman's way of getting things done. They can automate everyday tasks, shorten the required time to do something, and translate a complex process into something anyone could operate.\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:image\",\"content\":\"https://msgang.com/uploads/b0ea6b16a201.png\"}],[\"$\",\"link\",\"19\",{\"rel\":\"icon\",\"href\":\"/favicon.svg\",\"type\":\"image/svg+xml\"}],[\"$\",\"link\",\"20\",{\"rel\":\"icon\",\"href\":\"/favicon.ico\"}],[\"$\",\"link\",\"21\",{\"rel\":\"apple-touch-icon\",\"href\":\"/apple-icon.png\"}],[\"$\",\"$L2a\",\"22\",{}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"e:\"$9:metadata\"\n"])</script></body></html>