I'm having a problem here ..
I need to find out the real username of the account executing the script. The problem is that I run my script on a User-Account with reduced privileges. But my script needs admin rigths and when they are granted the value @username changes to the admin account.
Look for yourself:
MsgBox(0, 0, @UserName)
executed on an account without admin privileges return the real username.
#RequireAdmin
MsgBox(0, 0, @UserName)
This returns the username of the admin.
I can understand that this happens, but I need to get the username of the currently logged in account.
And I want to achieve this without the execution of another script and without elevating my exe afterwards to admin rights ..
I hope you understand what I want to achieve ..
Thanks or your help