I am trying to use the windows Environment Variable %USERNAME% in my configuration file(s) but it does not seem to work. Is there a trick to this? I something blocking it from working? When I use the %USERNAME% in the configuration that is what show in the configuration dialog not resultant system username that would allow me to point to C:\Users\mlongstreet\...
Mike Longstreet said:I am trying to use the windows Environment Variable %USERNAME%
We can't see your configuration so it's hard to comment.
However, in a MicroStation configuration file you use a Windows environment variable with the same syntax as if it were a MicroStation configuration variable...
MY_FOLDER1 = //ServerName/Projects/YourNameHere/ # literal MY_FOLDER2 = //ServerName/Projects/$(USERNAME)/ # substitute Windows variable
That is, you don't use percent (%) signs to bracket the variable – that's a Windows requirement not a MicroStation requirement.
Regards, Jon Summers LA Solutions
Answer Verified By: Mike Longstreet
By default, the MicroStation configuration variable _USTN_USERNAME has the same value as USERNAME, which is the Windows Environment Variable.
You can test it in the key-in window using the key-in: expand echo $(environment variable name)
e.g. expand echo $(username)
That may be the problem I was using the %USERNAME% and should be using $(USERNAME).
Mike LongstreetVermont Agency of TransportationCivil Engineering Technical SupportVTCAD Help
_USTN_USERNAME is in my case defined by the System and is "Personal" when using MicroStation.
_USTN_USERNAME is OpenRoadsDesigner_ when using OpenRaods so that is not really going to work well.
When I key in "expand echo $(username)" it returns $(username) not the system username. Still going to add it to the config like that and see if it works.
Mike Longstreet said:When I key in "expand echo $(username)" it returns $(username) not the system username.
Look in the Message Centre (not the status bar) and see what it returns.