Calling an external process in the export script
Using an export script to call an external process that does not call back the script itself will cause the task to freeze at the publication stage. This will cause all subsequent tasks to remain stuck in the publication queue as well. The script timer will also not work, because it counts the time taken to switch between lines of code, which does not happen in this case.
To prevent the task from getting stuck because of the above, launch the external process using the Exec() command instead of the Run() command.
Sample script:
var wsh = new ActiveXObject("Wscript.Shell");
var ex = wsh.Exec(cmd);
while ( ex.Status == 0 ) {
wsh.Run( "%COMSPEC% /c timeout /t 1 /nobreak > nul", 0, true );
}
3/26/2024 1:49:49 PM