Setting Username Environment Variable Manually

Local time
Today, 07:13
Joined
Feb 25, 2008
Messages
410
I have a batch file that copies a program to a user's local machine.
The batch file points to a path like this:
"C:\documents and settings\%username%\Desktop\"
which works 99% of the time, however, sometimes, the domain servers change a user's profile folder to "username.domain" and thus the above link does not work for those users.
The easiest method I have found to fix this, is to manually set the windows environment variable %username% to "username.domain"
And it works like a charm, but I have to make sure it won't affect anything else in the future. Does anybody see any issues arising by doing it this way?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom