'Scheduled Task (hidden GUI) failed to run as System

I want to run an exe (console based) with hidden GUI as task. I don't know the client PC account info so want to run it as System. But On starting task, Its state is set Ready immediate with operation code 2.

schtasks /create /SC ONLOGON /TN "3Test Task" /TR "C:\Program Files (x86)\ABC\XYZ\App.exe" /RL HIGHEST /RU "NT AUTHORITY\SYSTEM"

Result: Setting in Scheduled Tasks win10

Is there any way that current user name can be get on runtime in schtasks script ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source