I'm trying to write a batch script where I can right-click a file and run a command prompt as administrator to run the file (in order to end-run around Windows 10's pickiness about driver files with insufficient certificates). It mostly works so far, but I've struck out on finding help for the last issue.
set d=%DATE% set t=%TIME% schtasks /create /tn RunCMD /tr "cmd '%1'" /rl HIGHEST /ru <user> /rp <password> /sc once /st %t:~0,8% /sd %d:~4,10% /v1 /z schtasks /run /tn RunCMD pause
D:\Backup\Drivers>set d=Thu 03/10/2016 D:\Backup\Drivers>set t=12:14:24.29 D:\Backup\Drivers>schtasks /create /tn RunCMD /tr "cmd '"D:\Backup\Drivers\IS_RT2860_W7-22.214.171.124_W8-126.96.36.199_W8Blue-188.8.131.52_W10-184.108.40.206_20150909_220.127.116.11_Free.exe"'" /rl HIGHEST /ru <user> /rp <password> /sc once /st 12:14:24 /sd 03/10/2016 /v1 /z SUCCESS: The scheduled task "RunCMD" has successfully been created. D:\Backup\Drivers>schtasks /run /tn RunCMD SUCCESS: Attempted to run the scheduled task "RunCMD". D:\Backup\Drivers>pause Press any key to continue . . .
A new window opens (taskeng.exe, not cmd.exe, which is odd) and it gives me the path that you get when running it as administrator, but it doesn't have any arguments.
How do I get the opened command prompt to accept the argument I'm trying to give it?