Suppose I installed a new package with someProgram
in it:
myNewPackageDir/bin/someProgram
If I want to accessing it from cmd using only its name (example: someProgram --option1 a --option2 b --option3 c
), I would have to append someProgram
's folder to the PATH variable:
setx PATH "%path%;myNewPackageDir\bin"
I keep installing many packages on windows through winget, and everytime a new package is installed, i have to add this new program's folder path to the PATH
variable so i can call it from cmd directly.
Any other way around this? Is there a better approach? My PATH
variable is really long now(>1000 characters), and I don't want to keep adding every new program's directory to the PATH
variable. The whole reason i add it to the PATH
variable is so that i can call it directly, but this process is becoming cumbersome with more packages being installed.
So how do i call programs directly without adding it to my PATH
variable?
(Also, I am using Windows 10.)
\
, but i wrote/
here by mistake, but that's not the point.doskey /?
. You load your alias at Command Prompt startup by specifying a batch or command atHKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor
and create theAutoRun
string value.