Here's an example of how this could be used to install OneDrive. OneDrive is a tricky beast as it needs to be installed peruser and percomputer so in order to install it to a user that isn't an admin you need to install it once as admin first (to do the percomputer bit). If we could use the {userdomain} and {username} action parameters in deployments, OneDrive could be installed silently (and in a single package installer) like this:
Step 1. Install OneDrive as SYSTEM
OneDriveSetup.exe /Silent
Step 2. Install OneDrive as User
SCHTASKS /Create /TN "Install OneDrive Task" /TR "OneDriveSetup.exe /Silent /Peruser /Childprocess" /SC ONCE /SD 20/10/2010 /ST 20:10 /RU {userdomain}\{username} /F && SCHTASKS /Run /TN "Install OneDrive Task" && SCHTASKS /Delete /TN "Install OneDrive Task" /F
BTW. The SCHTASKS method works in actions (to run action as Admin but launch executable as user). Here's the code for that:
cmd.exe /K SCHTASKS /Create /S {smartname} /TN "Run Calculator Task" /TR "calc.exe" /SC ONCE /SD 20/10/2010 /ST 20:10 /RU {userdomain}\{username} /F && SCHTASKS /Run /S {smartname} /TN "Run Calculator Task" && SCHTASKS /Delete /S {smartname} /TN "Run Calculator Task" /F
Please LIKE this thread if you think this feature would be useful.