How to open a .exe file using an abbreviation in CMD
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
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 |
protected by Community♦ Dec 3 at 19:32
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
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
2,2593824
2,2593824
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
250k11258556
250k11258556
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
13.9k31938
13.9k31938
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
1,030137
1,030137
add a comment |
add a comment |
protected by Community♦ Dec 3 at 19:32
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?