Use System variables, like :
%USERPROFILE%
%HOMEPATH%
etc...
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi everyone, here's my problem, I'm doing an internship in a company and I was asked to find a way to make a shortcut in a folder that is in my Pc but I want it to work in any other computer. To do so I want to replace the "C:/users/username/desktop/folder" for a "Variable". than in every computer or user that i want to use this shortcut I just have to say that "variable" means "C:/users/username" or "D:/" or wherever i put the folder in.
thanks.
Use System variables, like :
%USERPROFILE%
%HOMEPATH%
etc...
Hi,
Thank you for posting the query on Microsoft Community
Environment variables are mainly used within batch files, they can be created, modified and deleted for a session using the SET command. To make permanent changes, use SETX
Variables can be displayed using either SET or ECHO.
Variables have a percent sign on both sides: %ThisIsAVariable%
The variable name can include spaces, punctuation and mixed case: %_Another Ex.ample%
(This is unlike Parameter variables which only have one % sign and are always one character long: %A )
A variable name may include any of the following characters:
A-Z, a-z, 0-9, # $ ' ( ) * + , - . ? @ [ ] _ ` { } ~
The first character of the name must not be numeric.
Windows Environment Path Variables
%AllUsersProfile% - Open the All User's Profile C:\ProgramData
%AppData% - Opens AppData folder C:\Users{username}\AppData\Roaming
%CommonProgramFiles% - C:\Program Files\Common Files
%CommonProgramFiles(x86)% - C:\Program Files (x86)\Common Files
%HomeDrive% - Opens your home drive C:\
%LocalAppData% - Opens local AppData folder C:\Users{username}\AppData\Local
%ProgramData% - C:\ProgramData
%ProgramFiles% - C:\Program Files or C:\Program Files (x86)
%ProgramFiles(x86)% - C:\Program Files (x86)
%Public% - C:\Users\Public
%SystemDrive% - C:
%SystemRoot% - Opens Windows folder C:\Windows
%Temp% - Opens temporary file Folder C:\Users{Username}\AppData\Local\Temp
%UserProfile% - Opens your user's profile C:\Users{username}
%AppData%\Microsoft\Windows\Start Menu\Programs\Startup - Opens Windows 10 Startup location for program shortcuts
--If the reply is helpful, please Upvote and Accept it as an answer–