DougInCanada
Technical User
I am trying to use the USERPROFILE environment variable in my script to create a specific file on a server.
strRequestor = objShell.ExpandEnvironmentStrings("%userprofile%")
strResponseFile = "\\ott-protect\Results\" & strRequestor & ".UAT"
Unfortunately, the userprofile is not cooperating. If the username is 8 characters, there's not a problem. But if the username is less than 8 characters (ie: 7) then strRequestor comes back as '\[username]'. The problem is also occurring with usernames less than 7 (ie: 5).
Regardless of the number of characters in the username, should this variable only come back with whatever follows [domain\] ?
If this is normal behaviour, how do I compensate for this in my code?
All help is greatly appreciated!
strRequestor = objShell.ExpandEnvironmentStrings("%userprofile%")
strResponseFile = "\\ott-protect\Results\" & strRequestor & ".UAT"
Unfortunately, the userprofile is not cooperating. If the username is 8 characters, there's not a problem. But if the username is less than 8 characters (ie: 7) then strRequestor comes back as '\[username]'. The problem is also occurring with usernames less than 7 (ie: 5).
Regardless of the number of characters in the username, should this variable only come back with whatever follows [domain\] ?
If this is normal behaviour, how do I compensate for this in my code?
All help is greatly appreciated!