cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The PTC Community email address has changed to community-mailer@ptc.com. Learn more.

Getting the username?

thendricks
3-Visitor

Getting the username?

In the DOS shell you can use %username% to grab the current user name. I'm looking for an equivalent for IsoDraw but have not had any luck in the macro help section. I'm hoping I'm just missing it. If anyone has a suggestion in getting the user name to a variable, it would be appreciated.
3 REPLIES 3

My endeavor was to use the %username% in a FWrite command so that we could track usage of macros as well as tracking what user last "touched" an illustration. I was able to solve my problem using the Launch command to create a txt file.

I'm trying to understand your resolution here. I've been working at the macro to find out the %username% and the %userprofile% so I can have the export macro work on every ones computer and it will export on to there user path. I have tried using the LAUNCH Command Prompt and having it copy to my clip board but does not work as far as I can tell.

LAUNCH "C:\windows\system32\cmd.exe" "echo %username% >%userprofile%\Username.txt"

and many other things.

All I want is the path to be made into a string in the macro.

Example my path is "C:\Users\brian.lau2\Desktop"

I want something like

DEFINE UserName AS String

UserName = %userprofile%

Message UserName

Then it messages "C:\Users\brian.lau2\Desktop"

In your Youtube video https://www.youtube.com/watch?v=V_fEsIcUNd0 you mention how you use the Text-Excerpt to bring in text and mention some post on these forums but I cannot find it. Can you also point me to where this is?