fcjoe Posted December 11, 2008 Posted December 11, 2008 Hello, AutoIt has a built in macro for username (@Username). But how do you get the full name (First and Last name) of the current logged on user? Is there a way to do this? Thanks, Joe
Marlo Posted December 11, 2008 Posted December 11, 2008 Maybe look to the registry? Click here for the best AutoIt help possible.Currently Working on: Autoit RAT
someone Posted December 11, 2008 Posted December 11, 2008 Try this courtesy of weaponxMsgBox(0,"User Full Name",GetFullName(@UserName)) Func GetFullName($sUserName) $colItems = "" $strComputer = "localhost" $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_UserAccount WHERE Name = '" & $sUserName & "'", "WQL", 0x10 + 0x20) If IsObj($colItems) then For $objItem In $colItems Return $objItem.FullName Next Else Return SetError(1,0,"") Endif EndFuncOriginal post http://www.autoitscript.com/forum/index.ph...ic=79129&hl While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd
fcjoe Posted December 11, 2008 Author Posted December 11, 2008 Try this courtesy of weaponx MsgBox(0,"User Full Name",GetFullName(@UserName)) Func GetFullName($sUserName) $colItems = "" $strComputer = "localhost" $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_UserAccount WHERE Name = '" & $sUserName & "'", "WQL", 0x10 + 0x20) If IsObj($colItems) then For $objItem In $colItems Return $objItem.FullName Next Else Return SetError(1,0,"") Endif EndFunc Original post http://www.autoitscript.com/forum/index.ph...ic=79129&hl Perfect, Thanks
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now