Creating a Windows Batch Script

A few solutions that I will post in the future will utilise Windows Batch scripts (.bat) files. Here is a quick tutorial on how to create a batch script in Windows:

  1. In Windows Explorer, click on Tools (press alt key if you can’t see it), then select Folder Options
  2. Click the View tab. Under Advanced settings, untick Hide extensions for known file types and click OK to save changes.
    Folder Options
  3. Open your favorite text editor e.g. notepad
  4. Type in the Windows commands that you want to include in your batch script e.g. net stop spooler
  5. Click on File, then select Save as
  6. Under Save as type, click the dropbox and select All Files
    Save as image
    Type in a relevant name and make sure you add a .bat at the end e.g. StopSpool.bat
  7. Save the file to your required location e.g. desktop. Browse to the saved location and TEST script to see if it works. You will notice that the .bat extension will be displayed.

Happy scripting 🙂

Leave a Reply

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