Powershell GUI script help
Well i would honestly think about using something else than PowerShell. Here you are running Batch file and not PowerShell file but anyhow i would use a language geared toward UI.
You could in maybe 15 minutes (for a newbie) do that in simple language like C#.
1 - You just pick the winform template project and it will create a single window and open it in the editor.
2 - drag drop a button control from the toolbox (on the left i believe) onto the window and size it with your mouse
3 - click once on it to edit the text value that is in the "text" property in the property grid on the right'
4 - Double click the button to open the code to perform when you click it
5 - run the batch you want with 1 line of code. Most likely Process.Start("C:\\Users\\Users\\Desktop\\Restart_Spooler.bat");
6 - create more button and trigger more script.
7 - press F5 to build and run the code
8 - open the project folder and in there you have an YourProjectName.exe ready to use
If you want to go deeper in the futur and actually run PowerShell commands, in C# you can run these command directly using the same way of writing but using the API functions.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now