Integrating JScript and VBScript in Your Tasks



<VBScript> ... </SCRIPT>
<JScript> ... </SCRIPT>

You can use these constructs in order to integrate scripting languages VBScript and JScript, respectively, in your own tasks. Scripts in these languages may include nnCron's predefined variables surrounded by two percent signs (%).

Example:

#( jscript-calc
Time: 0 12 * * * *
Action:
    <JScript>
        var WshShell = WScript.CreateObject("WScript.Shell");
        WshShell.Run("calc");
        WScript.Sleep(100);
        WshShell.AppActivate("Calculator");
        WScript.Sleep(100);
        WshShell.SendKeys("2{+}2{*}3=");
    </SCRIPT>
)#

Version 2.0 of Windows Script Host (WSH) should be installed on your computer in order for this example to run correctly..

If you are using Windows 2000/XP or Windows ME, version 2.0 of WSH is already installed on your system. If you are using Windows 95, 98 or Windows NT 4.0, you probably have obsolete version 1.0. To update your WSH to version 5.6 or newer, go to Microsoft Windows Script Technologies Web site.