Here is an AutoIT script and executable that takes a LabVIEW VI path, opens the VI and then runs the VI.
Script and download below.
#include <File.au3>
If $CmdLine[0] > 0 Then
; assume first parmaeter is the file and path of the VI
Local $sFilePath = $CmdLine[1]
Local $sDrive = "", $sDir = "", $sFilename = "", $sExtension = ""
Local $aPathSplit = _PathSplit($sFilePath, $sDrive, $sDir, $sFilename, $sExtension)
; generate the window title
Local $sTitle = $sFilename & $sExtension & " Front Panel"
; run the VI
ShellExecute($sFilePath )
; wait till the VI opens
WinWaitActive($sTitle)
; send CTRL-R to start to RUN
Send("^r")
EndIf
Open and Run LabVIEW VI AutoIt
Open and Run LabVIEW VI EXE
Use as follows;
open-run-labiew-vi.exe "C:\Users\UserName\Desktop\VIName.vi"
Leave a Reply