18.01.2015 Views

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix: Built-in Scripting Language<br />

Value<br />

Description<br />

0 Command was not executed successfully.<br />

1 Command was executed successfully.<br />

Please note that this indicates only whether the command started its execution successfully, particularly if it<br />

is executed asynchronously. It does not indicate when or how the command finished its execution.<br />

Examples<br />

Start Notepad, and then immediately continue to the next line of the script:<br />

WinExec( "C:\Windows\System32\notepad.exe", 4 )<br />

Start MS Paint, and then immediately continue to the next line of the script:<br />

WinExec( "C:\Windows\System32\mspaint.exe" )<br />

Call a batch file, execute it in hidden mode, wait until it's finished before continuing, and then store the exit<br />

code in the tag return:<br />

WinExec( "CMD /C call C:\Temp\MyBatch.bat", 0, 1, "return" )<br />

Call a VBScript file, execute it in hidden mode, and then immediately continue, storing the handle in the tag<br />

handle:<br />

WinExec( "CMD /C call C:\Temp\MyScript.vbs", 0, 0, "handle" )<br />

Note: Calling VBScript files is not supported on Windows Embedded target systems.<br />

WinExecIsRunning<br />

Indicates whether a program started by the WinExec function is still running.<br />

Function Group Execution Windows Embedded Thin Client<br />

WinExecIsRunningModule Activity Synchronous Supported Supported Supported<br />

Syntax<br />

WinExecIsrunning( numHandle, "optTagReturn" )<br />

numHandle<br />

Handle number stored in the tag in the optStrReturnorHandle parameter of the WinExec<br />

function.<br />

"optTagReturn"<br />

Tag that receives the code returned by the program executed by the WinExec function.<br />

Returned value<br />

0 Successful execution.<br />

-1 Invalid parameter(s).<br />

-2 Failed to open file. Disk is write protected or file name is invalid.<br />

Page 624<br />

<strong>InduSoft</strong> Web Studio

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!