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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How to use Windows system token(variable) in mapkey for user id

danders238
15-Moonstone

How to use Windows system token(variable) in mapkey for user id

Hi,

What's the proper way to use the windows system token(variable) for user id in a mapkey?
I would like to replace johndoe with windows %username% token.

I have tried $USER and $USERNAME with no success.
Could someone point me to the correct syntax for using a system variable in a mapkey? 

 

mapkey(continued) ~ Select `file_saveas` `ph_list.Filelist` 1 `c:`;\
mapkey(continued) ~ Activate `file_saveas` `ph_list.Filelist` 1 `c:`;\
mapkey(continued) ~ Select `file_saveas` `ph_list.Filelist` 1 `Users`;\
mapkey(continued) ~ Activate `file_saveas` `ph_list.Filelist` 1 `Users`;\
mapkey(continued) ~ Select `file_saveas` `ph_list.Filelist` 1 `johndoe`;\
mapkey(continued) ~ Activate `file_saveas` `ph_list.Filelist` 1 `johndoe`;\
mapkey(continued) ~ Select `file_saveas` `ph_list.Filelist` 1 `mydocs_pb`;\
mapkey(continued) ~ Activate `file_saveas` `ph_list.Filelist` 1 `mydocs_pb`;\

 

Thanks for any help you can provide,

Don A

ACCEPTED SOLUTION

Accepted Solutions

Can you try $userprofile (%userprofile%)? We use this syntax in mapkeys and settings and it works well. Here's an old example of a model tree config path.

 

mdl_tree_cfg_file $USERPROFILE\Creo4\configs\tree.cfg - This points to C:\Users\Username\Creo4\configs

View solution in original post

2 REPLIES 2

Can you try $userprofile (%userprofile%)? We use this syntax in mapkeys and settings and it works well. Here's an old example of a model tree config path.

 

mdl_tree_cfg_file $USERPROFILE\Creo4\configs\tree.cfg - This points to C:\Users\Username\Creo4\configs

I was able to finally get it to work after doing the following:
Make sure not to navigate to a folder location but type in the full path to where you want to save or open something from!

You're file paths should look like the below text when viewing the mapkey in the config.pro file


mapkey(continued) ~ Input `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT` \
mapkey(continued) `C:\\Users\\$username\\Documents\\folder\\sub_folder\
mapkey(continued) ot_Delete`;\
mapkey(continued) ~ Update `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT` \
mapkey(continued) `C:\\Users\\$username\\Documents\\folder\\sub_folder\
mapkey(continued) ot_Delete`;~ Activate `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT`;\
mapkey(continued) ~ Activate `file_saveas` `OK`;~ Select `main_dlg_cur` `appl_casc`;\

danders238_1-1646773269301.png

My mapkeys now work 🙂
Thanks,

Don A

 

 

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags