I'm trying to have a button (btnStepTwo) in Java that when clicked, will run a .bat file (ScanRemote.bat) located on my desktop. Is this possible within Java? The .bat file then runs a .ps1 script since it looks like Java will not run a Powershell script directly. Thanks for any help!
Asked
Active
Viewed 37 times
1
-
You want to open/run PowerShell script within click made inside a Browser? What would You do with the script? SHow the content inside Browser or what? – devzom Nov 04 '22 at 18:18
-
Correct, I have another button that inputs a computer name. Then a PowerShell script that will take that computer name and give the software installed. End result would be to have the java application show the software installed in a table. – Brian Springer Nov 04 '22 at 19:18
-
See https://social.technet.microsoft.com/Forums/office/en-US/d32537bd-0aef-440e-8760-6b3085390c37/executing-powershell-script-via-java?forum=winserverpowershell for one way to do it. – Moshe Katz Nov 07 '22 at 03:28
-
Does this answer your question? [Executing PowerShell Commands in Java Program](https://stackoverflow.com/questions/29545611/executing-powershell-commands-in-java-program) – Moshe Katz Nov 07 '22 at 03:28