Tuesday 11 November 2014

Fetching the windows information (User name, Domain, Path, Computer name)


Sub test()

 
MsgBox Environ("username") ' Getting the Windows username

' Application.UserName would only populate the user name  for that particular application not the windows

MsgBox Environ("PATH") ' Getting the Path

MsgBox Environ("Computername") ' Getting the computer name

MsgBox Environ("Userdomain") ' Getting the domain you are logged in


MsgBox Environ("userprofile") ' path where user files are stored

End Sub

 

 

No comments:

Post a Comment