Link using %UserProfile%

User avatar
ErikJan
BronzeLounger
Posts: 1232
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Link using %UserProfile%

Post by ErikJan »

I want to add a hyperlink to an email where I point to a folder under "AppData". As user names obviously differ from system to system, I'd like to use the variable "Userprofile" (which typically is: C:\Users\UserId\, with "UserID" the name of the account logged on).
As I think I should use "%" around the variable, I now have something like this in the dialog box of the hyperlink-edit (that box converted my % to %25; which I understand): %25UserProfile%25/AppData/Local/Microsoft

This does not work however... where am I going wrong?

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Link using %UserProfile%

Post by Rudi »

See this reply in the Office TechCenter

Seems the trick is to hyperlink to a batch file that will open the userprofile window.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78440
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Link using %UserProfile%

Post by HansV »

If it worked, it would be even easier to use the environment variable LOCALAPPDATA, which points to C:\Users\<username>\AppData\Local. But, unfortunately, as you have found, it doesn't work. The file:/// protocol that is used for linking to local files can't handle environment variables.

Similar questions have been asked on other forums, and the consensus appears to be that it is impossible.

@Rudi: if you send someone an e-mail, it is unlikely that you can refer to a batch file...
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Link using %UserProfile%

Post by Rudi »

The article refers to saving the batch file on a shared drive:
"Share the .bat file on a network share so the recipients could reach it."
Of course this will only work in a network environment. Maybe ErikJan can use this if the case is true?
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78440
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Link using %UserProfile%

Post by HansV »

Yeah, OK, it would work within a network.
Best wishes,
Hans

User avatar
ErikJan
BronzeLounger
Posts: 1232
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Re: Link using %UserProfile%

Post by ErikJan »

Rudi, Hans, thanks for the help. I'll probably write <User> and explain what I mean ;-)