Universal user ID for hyperlinks to folders
Emily Wong
I would like to provide a link to the WORD STARTUP folder for my colleagues. How can I do this so that it works across all computers with different user login IDs?
Is there something I can put in the link that is universal to all users?
For example, the link is below.
What can I put in place of "[unique windows login ID]" that will allow them to simply copy and paste into the URL. The alternative is for me to just tell them to manually enter their unique user id.
C:\Users\ [unique windows login] \AppData\Roaming\Microsoft\Word 1 Answer
What can I put in place of "[unique windows login ID]"?
that will allow them to simply copy and paste into the URL. The alternative is for me to just tell them to manually enter their unique user id
C:\Users\ [unique windows login] \AppData\Roaming\Microsoft\WordYou can make use of %APPDATA%.
%APPDATA%expands toC:\Users\{username}\AppData\Roamingwhere{username}is the user name of the currently logged in user.
The examples below show you how to use %APPDATA%.
Notes:
If you only need up to the user name part of the path then you can use
%USERPROFILE%%USERPROFILE%expands to%SystemDrive%\Users\{username}, where%SystemDrive%will usually beC:, and{username}is the user name of the currently logged in user.environment variables list other interesting predefined environment variables that can be used in similar situations.
To use in a hyperlink
Type file://%APPDATA%\Microsoft\Word into a browser address bar.
This makes use of the the file URI scheme to address files on the local computer.
Many programs will recognise
file://%APPDATA%\Microsoft\Wordas a hyperlink which will open in the system default browser.
The file URI scheme is a URI scheme specified in RFC 1630 and RFC 1738, typically used to retrieve files from within one's own computer.
Source file URI scheme
To use in a shortcut:
You can use %APPDATA%\Microsoft\Word as the link Target.
Example:
I don't have Word installed but to test I created a shortcut to C:\Users\DavidPostill\AppData\Roaming\LibreOffice, and modified the shortcut properties as follows:
Set "Target" to "%APPDATA%\LibreOffice"
Click "OK"
The modified shortcut works as expected.
Further Reading
- An A-Z Index of the Windows CMD command line - An excellent reference for all things Windows cmd line related.
- environment variables - Environment variables are mainly used within batch files, they can be created, modified and deleted for a session using the SET command.