windows - folders./shortcuts

Jose Carvalho 1 Reputation point
2022-05-25T08:35:02.897+00:00

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.

Windows 10 Network
Windows 10 Network
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Network: A group of devices that communicate either wirelessly or via a physical connection.
2,266 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 81,461 Reputation points
    2022-05-25T08:40:46.557+00:00

    Use System variables, like :

    %USERPROFILE%
    %HOMEPATH%
    etc...

    0 comments No comments

  2. Limitless Technology 43,926 Reputation points
    2022-05-30T07:33:34.427+00:00

    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–

    0 comments No comments