Creating Command Prompt Shortcut with Specified Environment Path on Windows

Sometimes you might want to have a command prompt with the specified command such as php available, without specified the full path to the executable and without altering the system or user environment variables.

There are several ways to achieve this, and here is the simple way I liked to use.

  1. Make a copy of the Command Prompt shortcut in your start menu
  2. Right click on the new shortcut and click Properties
  3. In the Shortcut tab, append the following content into the Target text box. Make sure you got a space before /k
     /k "set path=%path%;C:\bin\php54"
  4. Replace the part C:\bin\php54 with the path to the folder where your executable files are located

At the end you will have something like this:

Command Prompt Shortcut

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s