How to Enhance Your Windows Batch Files by Adding GUI

Let’s modernize your old-fashioned Windows batch files with the help of PowerShell and .NET

Shalitha Suranga
The Startup

--

Photo by Bahman Adlou on Unsplash

We normally use Bash scripting on the Linux platform to perform various types of automation tasks. Similarly, we could write batch scripts on Windows. However, Microsoft introduced PowerShell scripting with the new versions of Windows by adding a way to use the modules of the .NET framework. PowerShell is having some advanced features such as object-based output, pipelines, and a lot of new commands compared to the old command prompt application. If you have several Bash scripts on Linux, commands such as zenity and notify-send can be used to modernize those scripts by adding graphical elements.

A few days ago, I was adding a new feature to Neutralinojs to display toast notifications on Windows. I had several options: implementing by using a library like WinToast, implementing from scratch, and achieving the same result by starting a process of PowerShell with a code-block. The third option was so quick, and the same concept can be applied to modernize old-fashioned Windows batch files too. If we write a batch file for a non-technical audience, it is always nice to use some GUI to enhance usability.

Basics

--

--

Shalitha Suranga
The Startup

Programmer | Author of Neutralinojs | Technical Writer