BookmarkSubscribeRSS Feed

Community Trekker


Jun 23, 2011

How to detect if JSL execution stops? like a timeout?

Does anyone know of any JSL to detect if JSL script execution has stopped processing?  In other words, how to detect a JSL timeout, etc?

Application: JSL will launch a batch file that is located on a local network path.  Win8/JMP 11.1.1.

web(myNetworkFolderPath || "launch.bat");

Issue: Win8 stops the execution with a prompt "Open File - Security Warning.  We can't verify who created this file.  Are you sure you want to open this file?"

But this actually stops the execution in the JSL script.  I know how to fix the Win8 prompt, no big deal.  But what I'd like to do is to have JSL detect that it has stopped.  I've tried a While loop, but once again the JSL code simply stops processing within the While loop.  So I'm unable to trap or detect that the JSL code has stopped processing.  If I could detect that the JSL has stopped processing say through a timeout (e.g. 10 seconds), then I would like to prompt the user using JSL to do the steps to fix Win8 config.

thanks, dj




Mar 21, 2013

Re: How to detect if JSL execution stops? like a timeout?

try RunProgram.

filename = savetextfile("$temp\test.bat","echo hello world\!n");

RP = RunProgram(

    Executable( filename ),

    ReadFunction( "text" )



>echo hello world

hello world


Above, RunProgram sees "text" as the ReadFunction value and just waits for the external program to complete, then returns the output.  RunProgram can also work in a polled mode or a callback mode.  The scripting index has several examples (look for the combo box to select examples).