To show an example of passing the username of the current logged on user through an Encypted RunAs shortcut, create a test.bat file and paste in the following:
echo Current logged on user: %1
echo Account used in Encrypted RunAs: %username%
For this example, I am logged in as 'Paul' and the Encrypted RunAs shortcut is using the 'Administrator' account.
1. Type Username (Administrator), Password and in the command browse to the test.bat file created above.
2. Add <arg> to the parameters box in Encrypted RunAs.
3. Save Shortcut. Right click the Windows Shortcut created by Encrypted RunAs and select edit, in the target box add /arg %username% (in a script it would look like this (%WINDIR%\ERunAs.exe %WINDIR%\test.eras /arg %username%). Click Ok to re-save the shortcut.
Double click the shortcut, the command prompt box should display:
Current logged on user: Paul
Account used in Encrypted RunAs: Administrator
Press any key to continue . . .