Appendix: Built-in Scripting Language Examples Start Notepad, and then immediately continue to the next line of the script: WinExec( "C:\Windows\System32\notepad.exe", 4 ) Start MS Paint, and then immediately continue to the next line of the script: WinExec( "C:\Windows\System32\mspaint.exe" ) Call a batch file, execute it in hidden mode, wait until it's finished before continuing, and then store the exit code in the tag return : WinExec( "CMD /C call C:\Temp\MyBatch.bat", 0, 1, "return" ) Call a VBScript file, execute it in hidden mode, and then immediately continue, storing the handle in the tag handle : WinExec( "CMD /C call C:\Temp\MyScript.vbs", 0, 0, "handle" ) Note:
Calling VBScript files is not supported on Windows Embedded target systems. WinExecIsRunning Indicates whether a program started by the WinExec function is still running. Syntax WinExecIsrunning( numHandle , " optTagReturn " ) numHandle Handle number stored in the tag in the optStrReturnorHandle parameter of the WinExec function. "optTagReturn" Tag that receives the code returned by the program executed by the WinExec function. Returned value Examples Page 520 InduSoft Web Studio Function Group Execution Windows Embedded Thin Client WinExecIsRunn inMgodule Activity Synchronous Supported Supported Supported 0 Successful execution. -1 Invalid parameter(s). -2 Failed to open file.
Disk is write protected or file name is invalid. Tag Name Expression Tag WinExecIsRunning( numHandle ) Tag WinExecIsRunning( numHandle, "return" )