[MS CE U12] Windows variable not being evaluated

We have a configuration that remaps the User Preference files using something like this.:

#--------------------------------------------------------------------
# Redirect User Preferences Location
#--------------------------------------------------------------------
_MY_PREFS = C:/CADD/Users/
_USTN_USER = $(_MY_PREFS)$(USERNAME)/$(_ENGINENAME)/
_USTN_HOMEROOT = $(_USTN_USER)
_USTN_HOMEPREFS = $(_USTN_USER)

This works most of the time, but in some situations MicroStation is not evaluating the windows USERNAME variable.

Instead of having _USTN_USER defined as C:/CADD/Users/<username>/MicroStation/ it gets defined as  C:/CADD/Users/MicroStation/

What little hair I have left is quickly being pulled out trying to figure out what is causing this. The really odd part is that it works sometimes, but not others. 

Has anyone else run into this or have suggestions?

Thanks.