How to open a .exe file using an abbreviation in CMD
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I want to start an .EXE file using one command, an abbreviation or alias you could say.
For example, I want to open Far Manager using an alias, I have at first to CD into the path, which is c:UsersmyUserdesktopfarfar.exe
.
I know about the set "alias=myCommand param1 param2"
but the problem is I want a single command to open up the application, for example Atom and VSCode have this feature, if I type atom or code in cmd it will open up. so I want to set a single command to open up the application without having to changing the directory into it at first and then use the start
command.
windows command-line
add a comment |Â
up vote
1
down vote
favorite
I want to start an .EXE file using one command, an abbreviation or alias you could say.
For example, I want to open Far Manager using an alias, I have at first to CD into the path, which is c:UsersmyUserdesktopfarfar.exe
.
I know about the set "alias=myCommand param1 param2"
but the problem is I want a single command to open up the application, for example Atom and VSCode have this feature, if I type atom or code in cmd it will open up. so I want to set a single command to open up the application without having to changing the directory into it at first and then use the start
command.
windows command-line
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I want to start an .EXE file using one command, an abbreviation or alias you could say.
For example, I want to open Far Manager using an alias, I have at first to CD into the path, which is c:UsersmyUserdesktopfarfar.exe
.
I know about the set "alias=myCommand param1 param2"
but the problem is I want a single command to open up the application, for example Atom and VSCode have this feature, if I type atom or code in cmd it will open up. so I want to set a single command to open up the application without having to changing the directory into it at first and then use the start
command.
windows command-line
I want to start an .EXE file using one command, an abbreviation or alias you could say.
For example, I want to open Far Manager using an alias, I have at first to CD into the path, which is c:UsersmyUserdesktopfarfar.exe
.
I know about the set "alias=myCommand param1 param2"
but the problem is I want a single command to open up the application, for example Atom and VSCode have this feature, if I type atom or code in cmd it will open up. so I want to set a single command to open up the application without having to changing the directory into it at first and then use the start
command.
windows command-line
asked Aug 29 at 18:21
Mahmoud Abd-El Ghany
82
82
add a comment |Â
add a comment |Â
4 Answers
4
active
oldest
votes
up vote
2
down vote
accepted
One way to do this is to add the folder path for the executable to your PATH
environment variable.
In Windows 7, 8 and 10, you can:
- Open the Start menu
- Type "environment variables"
- Click "Edit the system environment variables"
- Click the Environment Variables button
- In the System variables section, select the Path variable and click the Edit button.
Alternatively (also for older versions of Windows):
- Right click "Computer", "This Computer" or "This PC" on your desktop.
- Click Properties
- Click the Advanced Tab
- Click the Environment Variables button
- In the System variables section, select the Path variable and click the Edit button.
In Windows 10 (and possibly 8?), you will see an edit window that makes it easy to add a path. In prior editions of Windows, you will see a text box edit window. Add the folder path to the end, preceded by a semi-colon: ;c:UsersmyUserdesktopfarfar.exe
add a comment |Â
up vote
2
down vote
The simplest solution would be to put your code into a .bat
file,
then add its folder into the PATH environment variable (or store the file into
a folder that is already in the PATH).
To avoid seeing the commands execute, start the file with an @echo off
line.
This would definitely be my approach too.
â LPChip
Aug 29 at 18:50
add a comment |Â
up vote
2
down vote
One more option is to use doskey
, which gives a macro function in cmd
:-
doskey MacroName=pushd c:UsersmyUserdesktopfar $T start far.exe $ popd
You can add this command to a cmd
start-up file.
Yet another option is to set the directory and program name in a program shortcut (eg far.lnk
) which you can create in a directory already in your path. Such files can be called direct from cmd
.
add a comment |Â
up vote
1
down vote
If you want to be able to start a command without having to specify the full path, you have to include the directory in your PATH
variable. You can see the current PATH
with
echo %PATH%
add a comment |Â
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
One way to do this is to add the folder path for the executable to your PATH
environment variable.
In Windows 7, 8 and 10, you can:
- Open the Start menu
- Type "environment variables"
- Click "Edit the system environment variables"
- Click the Environment Variables button
- In the System variables section, select the Path variable and click the Edit button.
Alternatively (also for older versions of Windows):
- Right click "Computer", "This Computer" or "This PC" on your desktop.
- Click Properties
- Click the Advanced Tab
- Click the Environment Variables button
- In the System variables section, select the Path variable and click the Edit button.
In Windows 10 (and possibly 8?), you will see an edit window that makes it easy to add a path. In prior editions of Windows, you will see a text box edit window. Add the folder path to the end, preceded by a semi-colon: ;c:UsersmyUserdesktopfarfar.exe
add a comment |Â
up vote
2
down vote
accepted
One way to do this is to add the folder path for the executable to your PATH
environment variable.
In Windows 7, 8 and 10, you can:
- Open the Start menu
- Type "environment variables"
- Click "Edit the system environment variables"
- Click the Environment Variables button
- In the System variables section, select the Path variable and click the Edit button.
Alternatively (also for older versions of Windows):
- Right click "Computer", "This Computer" or "This PC" on your desktop.
- Click Properties
- Click the Advanced Tab
- Click the Environment Variables button
- In the System variables section, select the Path variable and click the Edit button.
In Windows 10 (and possibly 8?), you will see an edit window that makes it easy to add a path. In prior editions of Windows, you will see a text box edit window. Add the folder path to the end, preceded by a semi-colon: ;c:UsersmyUserdesktopfarfar.exe
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
One way to do this is to add the folder path for the executable to your PATH
environment variable.
In Windows 7, 8 and 10, you can:
- Open the Start menu
- Type "environment variables"
- Click "Edit the system environment variables"
- Click the Environment Variables button
- In the System variables section, select the Path variable and click the Edit button.
Alternatively (also for older versions of Windows):
- Right click "Computer", "This Computer" or "This PC" on your desktop.
- Click Properties
- Click the Advanced Tab
- Click the Environment Variables button
- In the System variables section, select the Path variable and click the Edit button.
In Windows 10 (and possibly 8?), you will see an edit window that makes it easy to add a path. In prior editions of Windows, you will see a text box edit window. Add the folder path to the end, preceded by a semi-colon: ;c:UsersmyUserdesktopfarfar.exe
One way to do this is to add the folder path for the executable to your PATH
environment variable.
In Windows 7, 8 and 10, you can:
- Open the Start menu
- Type "environment variables"
- Click "Edit the system environment variables"
- Click the Environment Variables button
- In the System variables section, select the Path variable and click the Edit button.
Alternatively (also for older versions of Windows):
- Right click "Computer", "This Computer" or "This PC" on your desktop.
- Click Properties
- Click the Advanced Tab
- Click the Environment Variables button
- In the System variables section, select the Path variable and click the Edit button.
In Windows 10 (and possibly 8?), you will see an edit window that makes it easy to add a path. In prior editions of Windows, you will see a text box edit window. Add the folder path to the end, preceded by a semi-colon: ;c:UsersmyUserdesktopfarfar.exe
answered Aug 29 at 18:39
Worthwelle
686114
686114
add a comment |Â
add a comment |Â
up vote
2
down vote
The simplest solution would be to put your code into a .bat
file,
then add its folder into the PATH environment variable (or store the file into
a folder that is already in the PATH).
To avoid seeing the commands execute, start the file with an @echo off
line.
This would definitely be my approach too.
â LPChip
Aug 29 at 18:50
add a comment |Â
up vote
2
down vote
The simplest solution would be to put your code into a .bat
file,
then add its folder into the PATH environment variable (or store the file into
a folder that is already in the PATH).
To avoid seeing the commands execute, start the file with an @echo off
line.
This would definitely be my approach too.
â LPChip
Aug 29 at 18:50
add a comment |Â
up vote
2
down vote
up vote
2
down vote
The simplest solution would be to put your code into a .bat
file,
then add its folder into the PATH environment variable (or store the file into
a folder that is already in the PATH).
To avoid seeing the commands execute, start the file with an @echo off
line.
The simplest solution would be to put your code into a .bat
file,
then add its folder into the PATH environment variable (or store the file into
a folder that is already in the PATH).
To avoid seeing the commands execute, start the file with an @echo off
line.
answered Aug 29 at 18:39
harrymc
236k9243521
236k9243521
This would definitely be my approach too.
â LPChip
Aug 29 at 18:50
add a comment |Â
This would definitely be my approach too.
â LPChip
Aug 29 at 18:50
This would definitely be my approach too.
â LPChip
Aug 29 at 18:50
This would definitely be my approach too.
â LPChip
Aug 29 at 18:50
add a comment |Â
up vote
2
down vote
One more option is to use doskey
, which gives a macro function in cmd
:-
doskey MacroName=pushd c:UsersmyUserdesktopfar $T start far.exe $ popd
You can add this command to a cmd
start-up file.
Yet another option is to set the directory and program name in a program shortcut (eg far.lnk
) which you can create in a directory already in your path. Such files can be called direct from cmd
.
add a comment |Â
up vote
2
down vote
One more option is to use doskey
, which gives a macro function in cmd
:-
doskey MacroName=pushd c:UsersmyUserdesktopfar $T start far.exe $ popd
You can add this command to a cmd
start-up file.
Yet another option is to set the directory and program name in a program shortcut (eg far.lnk
) which you can create in a directory already in your path. Such files can be called direct from cmd
.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
One more option is to use doskey
, which gives a macro function in cmd
:-
doskey MacroName=pushd c:UsersmyUserdesktopfar $T start far.exe $ popd
You can add this command to a cmd
start-up file.
Yet another option is to set the directory and program name in a program shortcut (eg far.lnk
) which you can create in a directory already in your path. Such files can be called direct from cmd
.
One more option is to use doskey
, which gives a macro function in cmd
:-
doskey MacroName=pushd c:UsersmyUserdesktopfar $T start far.exe $ popd
You can add this command to a cmd
start-up file.
Yet another option is to set the directory and program name in a program shortcut (eg far.lnk
) which you can create in a directory already in your path. Such files can be called direct from cmd
.
answered Aug 29 at 19:08
AFH
12.6k31735
12.6k31735
add a comment |Â
add a comment |Â
up vote
1
down vote
If you want to be able to start a command without having to specify the full path, you have to include the directory in your PATH
variable. You can see the current PATH
with
echo %PATH%
add a comment |Â
up vote
1
down vote
If you want to be able to start a command without having to specify the full path, you have to include the directory in your PATH
variable. You can see the current PATH
with
echo %PATH%
add a comment |Â
up vote
1
down vote
up vote
1
down vote
If you want to be able to start a command without having to specify the full path, you have to include the directory in your PATH
variable. You can see the current PATH
with
echo %PATH%
If you want to be able to start a command without having to specify the full path, you have to include the directory in your PATH
variable. You can see the current PATH
with
echo %PATH%
answered Aug 29 at 18:26
RalfFriedl
6737
6737
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1353519%2fhow-to-open-a-exe-file-using-an-abbreviation-in-cmd%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password