I've setup a script to create a task, but I'm getting an error.  I have the script setup as an Online KScript. And have the following line in "On Success" Launch $(KACE_SYS_DIR)\schtasks.exe with params /Create /XML \\uncname\folder\task.xml /tn UAC Whitelist\foldername
But it errors with.
Running as SYSTEM
ERROR: Access is denied.
Launched Process: schtasks.exe
Invalid number of parameters
Also I'm attempting to copy a shortcut to the user's desktop %username%\desktop, it says "the operation completed successfully" but the file isn't on the desktop. 
I've tested this with a batch file that I run manually on the desktop with elevated access and it works. 

1 Comment   [ - ] Hide Comment


  • I got it to work by converting the .bat to an exe and running this. “$(KACE_DEPENDENCY_DIR)\install.exe”
    Now my issue is that the task that is being created is setting the Security Options to System and won't run the task. Anyone know how\what to assign in the .xml to allow the currently logged on user to the security options?
Please log in to comment

Answer this question or Comment on this question for clarity


The script will run in the system context and won't have access to a network share unless the computer has access to the share itself (this normally is not the case). Upload the xml file as a script dependency and use the dependency directory variable instead.

Answered 05/27/2016 by: chucksteel
Red Belt

Please log in to comment
The short cut will not show up unless you run the script as logged in user.  By default is runs as system and the %username% variable is useless.  Other choice is to copy short cut to public's desktop
Answered 05/27/2016 by: SMal.tmcc
Red Belt

Please log in to comment