| View previous topic :: View next topic |
| Author |
Message |
interiot
Joined: 06 Nov 2005 Posts: 64
|
Posted: Tue May 27, 2008 11:00 pm Post subject: A_Username documentation |
|
|
The documentation says that A_UserName is "The logon name of the current user". But when if launched by RunAs, or if running as a service, this isn't the case.
MSDN's decription is more accurate: It's the username associated with the current thread (which is the same thing as the "The logon name associated with the current process" for all AHK scripts).
Is there a good suggested alternative in these cases? I'm not sure. WTSGetActiveConsoleSessionId may be a good starting place, but I can't get it to work. Several others have suggested finding the explorer.exe process, and finding out who owns that process, though that doesn't work if the explorer.exe process has crashed. Still others suggest trolling HKEY_USERS, converting those text SIDs into binary SIDs that you can use to find the usernames. There must be some terse way to do this...
Last edited by interiot on Thu May 29, 2008 4:06 am; edited 3 times in total |
|
| Back to top |
|
 |
infogulch
Joined: 27 Mar 2008 Posts: 148 Location: USA
|
Posted: Tue May 27, 2008 11:06 pm Post subject: |
|
|
Is this what displays in the "User Name" optional column in the Task Manager? (menu:View > Seclect Columns... > Checkbox:User Name) Just wondering. _________________
 |
|
| Back to top |
|
 |
k3ph
Joined: 21 Jul 2006 Posts: 127
|
Posted: Thu May 29, 2008 2:06 am Post subject: |
|
|
| hmm, you could check whoami (windows resource kit) |
|
| Back to top |
|
 |
|