How to show current user

Just want to see if anyone could help me?
Im looking to show the Current logged on Windows user when hovering over a computer.
One way I thought it might be possible is scripting a way of showing the most recent folder in C:/Users and fetching the name of it. EG: C:/Users/User01 and having the name of that folder show up.
Hope someone can help?

Justin

Go to Microsoft forum, this is MikroTik forum.

I’m asking about The Dude not a Microsoft product

The most reccent folder can be also 1990 (for example)…

The user folder is created when the first time the specified user are logged, and is not updated for every logon.

It is when using roaming profiles. When a user logs on to a box, a copy of their profile is downloaded/modified. If I could get the dude to find the recently modified folder in c:/users it could display who is logged on theoretically.

Can be…

I added this to the appearance of the computer

[Logged_in_User()] Which is the following function

array_element(execute(“cscript.exe”,concatenate("//NoLogo C:\ra\whoisloggedon.vbs ",User_Pass()),“C:\WINDOWS\system32\”),1)

whoisloggedon.vbs is the following script

‘loggeduser.vbs
’ Sample VBScript to discover which user is logged on
’ Author Guy Thomas and John Eck
’ Version 2.5 - December 2005
’ -------------------------------------------------------’
'Modified by gsandul to logon to remote host using
'username and password specified from command line

'Set objPassword = CreateObject(“ScriptPW.Password”)

'strComputer = “192.168.0.60”

'You can uncomment the following 3 lines and
'specify hardcoded domain, username and password

strDomain = “xxx”
strUser = “xxxxxx”
strPassword = “xxxxxxx”

'wscript.echo wscript.arguments(0)
', wscript.arguments(1), wscript.arguments(2), wscript.arguments(3)
strComputer = wscript.arguments(0)

'If you hardcoded domain, username and password
'comment the following 3 lines

'strDomain = wscript.arguments(1)
'strUser = wscript.arguments(2)
'strPassword = wscript.arguments(3)

'wscript.echo strdomain, struser, strpassword

Set objSWbemLocator = CreateObject(“WbemScripting.SWbemLocator”)
Set objWMIService = objSWbemLocator.ConnectServer(strComputer, _
“root\CIMV2”, _
strUser, _
strPassword, _
“MS_409”, _
“NTLMDomain:” + strDomain)
’ You suppose to be authentificated
’ Now you can write any WMI function

Set colComputer = objWMIService.ExecQuery (“Select * from Win32_ComputerSystem”)

For Each objComputer in colComputer
If not objComputer.UserName = “” Then
strLogonUser = Split(objComputer.UserName,"")
strLogonUser(1) = UCase(Left(strLogonUser(1),1))& Trim(Mid(strLogonUser(1),2,20))
Wscript.Echo strLogonUser(1)
'Wscript.Echo strLogonUser(1) & " is logged on to " & strComputer
Else
Wscript.Echo “No_one_is_logged”
End If
Next

’ End of Sample Logged on VBScript