<job><script language="VBScript">'---------------------------------------------------------' This sample launches the application as interactive user.'---------------------------------------------------------' A constant that specifies a registration trigger.const TriggerTypeRegistration = 7' A constant that specifies an executable action.const ActionTypeExecutable = 0' A constant that specifies the flag in RegisterTaskDefinition.const FlagTaskCreate = 2' A constant that specifies an executable action.const LogonTypeInteractive = 3If WScript.Arguments.Length <> 1 Then WScript.Echo "Usage: cscript launchapp.wsf <AppPath>" WScript.QuitEnd IfstrAppPath = WScript.Arguments(0)'********************************************************' Create the TaskService object.'********************************************************Set service = CreateObject("Schedule.Service")call service.Connect()strTaskName = "Launch App As Interactive User"'********************************************************' Get a folder to create a task definition in.'********************************************************Dim rootFolderSet rootFolder = service.GetFolder("\")'Delete the task if already presentOn Error Resume Nextcall rootFolder.DeleteTask(strTaskName, 0)Err.Clear'********************************************************' Create the new task'********************************************************Dim taskDefinitionSet taskDefinition = service.NewTask(0)'********************************************************' Create a registration trigger.'********************************************************Dim triggersSet triggers = taskDefinition.TriggersDim triggerSet trigger = triggers.Create(TriggerTypeRegistration)'***********************************************************' Create the action for the task to execute.'***********************************************************' Add an action to the task. The action executes the app.Dim ActionSet Action = taskDefinition.Actions.Create( ActionTypeExecutable )Action.Path = strAppPathWScript.Echo "Task definition created. About to submit the task..."'***********************************************************' Register (create) the task.'***********************************************************call rootFolder.RegisterTaskDefinition( _strTaskName, taskDefinition, FlagTaskCreate, _,, LogonTypeInteractive)WScript.Echo "Task submitted."</script></job>
Generated in 0.056 seconds in which 0.022 seconds were spent on a total of 14 queries. Zlib compression enabled.
") !=-1) { tempah=tempah.substring(tempah.indexOf("")+5,tempah.indexOf("")); codes[i].innerHTML="" + dotag(tempah.substring()) + ""; } } //var pres = document.getElementsByTagName("pre"); //for (var i=0, maxi = pres.length; i < maxi; i++) { // var tempah = pres[i].innerHTML; // if (tempah.indexOf("[postprep") !=-1) { // tempah=tempah.substring((tempah.indexOf("]",tempah.indexOf("[postprep"))+1)); // pres[i].innerHTML=dotag(tempah); // } //} function ytag(which_one) { var codes = document.getElementsByClassName("ubbcode-body"); var thisone = codes[which_one].innerHTML; codes[which_one].innerHTML = "" + dotag(thisone.substring(5+thisone.indexOf(""),thisone.indexOf(""))) + ""; var heads = document.getElementsByClassName("ubbcode-header"); heads[which_one].innerHTML = "Code:" + ' '; } function ttag(which_one) { var codes = document.getElementsByClassName("ubbcode-body"); var thisone = ""; if (codes[which_one].innerText != undefined) { thisone += codes[which_one].innerText; } else { thisone += codes[which_one].textContent; } codes[which_one].innerHTML = thisone + ""; var heads = document.getElementsByClassName("ubbcode-header"); heads[which_one].innerHTML = "Code:" + ' '; }
")+5,tempah.indexOf("
" + dotag(tempah.substring()) + "
" + dotag(thisone.substring(5+thisone.indexOf(""),thisone.indexOf(""))) + "
"),thisone.indexOf("
"; if (codes[which_one].innerText != undefined) { thisone += codes[which_one].innerText; } else { thisone += codes[which_one].textContent; } codes[which_one].innerHTML = thisone + "