Monday, February 06, 2012
   
Text Size

VB - Using System Variables

strUserProfilePath = WshShell.ExpandEnvironmentStrings("%USERPROFILE%")
MSGBOX "User Profile Path : " & strUserProfilePath

strUserName = WshShell.ExpandEnvironmentStrings("%USERNAME%")
MSGBOX "User Name : " & strUserName

strComputerName = WshShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
MSGBOX "Computer Name : " & strComputerName