LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Close execution of .exe started with SystemExec


@V.Life wrote:

Out of Labview I managed to open and close the prompt window using PowerShell. Can I use the SystemExec block to launch it and execute the same commands that I tried out of Labview? Thanks.


If you would like to kill your application with PowerShell like

Get-Process | Where-Object { $_.Path -like "*MyProgram.exe" } | Stop-Process -Force

then save it as PowerShell script like KillApp.ps1, then call it from LabVIEW like

powershell.exe -ExecutionPolicy Bypass -File "Your\Path\To\KillApp.ps1"

That is:

snippet.png

 

0 Kudos
Message 11 of 14
(73 Views)

Is it possible also to open the application with PowerShell? Thanks

0 Kudos
Message 12 of 14
(63 Views)

@V.Life wrote:

Is it possible also to open the application with PowerShell? Thanks


Yes, of course, something like that:

Start-Process "<YOUR PATH TO PROGRAM>\MyProgram.exe" -ArgumentList "arg1"

 

0 Kudos
Message 13 of 14
(47 Views)

I managed to execute the script to open the .exe file but it is executed in the black window, not in the window of Power Shell, so I can't close it with the script of closure.

0 Kudos
Message 14 of 14
(13 Views)