03-15-2023 05:19 AM
Hello,
i want to run a programm on labview, that communicates with the comandline. First of all it should open Powershell which is possible by using a System Exec vi and the cmd /c command.
After that i want to run another command in the same comandline which is connected to the powershell. How do i combine these two commands?
Another solution would be connecting to the powershell directly instead of opening the comandline at all, so i can input the command directly to the powershell.
A third solution would be, to combine those two commands (hoping into the powershell and coding without pressing enter).
I do not know how to implement this in labview.
03-15-2023 06:08 AM
@ranzinger wrote:
Hello,
i want to run a programm on labview, that communicates with the comandline. First of all it should open Powershell which is possible by using a System Exec vi and the cmd /c command.
After that i want to run another command in the same comandline which is connected to the powershell. How do i combine these two commands?
There's this : Execute Multiple Commands With One System Exec Call in LabVIEW - NI
But you might need to use a pipe. That's where it get's complicated...
@ranzinger wrote:Another solution would be connecting to the powershell directly instead of opening the comandline at all, so i can input the command directly to the powershell.
How about using .NET:
System.Management.Automation.PowerShell.Create();
@ranzinger wrote:A third solution would be, to combine those two commands (hoping into the powershell and coding without pressing enter).
That usually complicates things...
03-15-2023 06:42 AM
03-15-2023 06:42 AM
Thanks for the answer, what do you mean with using the.Net function?
03-15-2023 09:27 AM
@ranzinger wrote:
Thanks for the answer, what do you mean with using the.Net function?
System.Management.Automation.PowerShell.Create();
Or in LabVIEW: