Funny - I was going to point you to the @SID macro yesterday but got involved with another issue and came back just now to discover you found it.. ;\)

With our tool, many standard objects about the computer and current user are returned automagically, so only a few key parameters need to be extracted by your code and added to the parameter list. When the admin task runs, it has the computer name, user name, SID, and other values discovered by the user logging in, eliminating some of the issues you encountered.

You should also look at the tcLib UDF library on my web site. There are two versions - V2 uses JT.EXE from the resource kit, while V3 uses SchTasks.exe. V2 is for use on XP/W2K3 and earler systems, while V3 is for Vista and higher. Both libraries are syntax-identical and can manipulate tasks on any target platform. It provides a standard interface to create, modify, run/terminate, and query Scheduled Tasks on any Windows platform without needing to create cumbersome command lines or complex TSK or XML files.

This library is what makes the server based solution so powerful - just 4 lines of code to init, define, save, and then run a task on a remote system with any desired account. The task deletes itself when done, resulting in a very clean solution.
_________________________
Actually I am a Rocket Scientist! \:D