Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Windows 7.

I have a .exe file here:


When I am in the CMD window, I want to be able to type "dailybackup" in any directory and have it execute.

Do I still need to change the environment variables to do this or does Windows 7 have an easier more user-friendly way to do this now?

share|improve this question
up vote 10 down vote accepted

You still have to change the PATH environment variable to include c:\tools\

share|improve this answer

To add to Nifle's answer, to add to the PATH permanently:

setx path "%path%;c:\tools"

You need to close and start another CMD prompt to see the changes to PATH.

share|improve this answer

If you want to do this from ANY directory, then your only choice, as you've pointed out, is to modify the environment variables and add "c:\tools" to your System or current user's $PATH variable.

share|improve this answer
On Windows, environment variables are delimited by surrounding percents, i.e. %PATH%, not a preceding dollar sign. – Hello71 Aug 9 '10 at 21:10

There are a couple of ways to get there from here. The simplest (and safest, depending on your comfort level where editing the registry is involved) is to use a batch file and place it in the \Windows folder. For example, your batch file (named "dailybackup.bat" for consistency), might contain the following:

@echo off
cd /d c:\utils

I use this method for a number of commands/processes that I regularly use at the DOS prompt.

Alternatively, you can create an "alias" for the executable in the registry. To do this, go to "HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths". You'll see a whole lot of sub-keys here. What you want to do is add one for "dailybackup.exe". Right-click on "App Paths" and select "New" and "Key". Enter the key name (ending with .exe). (This is an opportunity to use a shortened version of the name, if you wish, such as "dbu.exe", for example. Anyway, enter your alias (we'll just go with "dailybackup.exe"). Now, in the right-hand pane, double click "Default" and enter the full path and name of your executable "c:\utils\dailybackup.exe". That's all there is to it. You're done with the registry. To use the new alias, you can hit (Windows Key)/R to get the "Run" box and enter your alias. For reasons which escape me, the alias won't work directly from a DOS prompt, but needs to be prefaced with "start", as in:

C:\Some\Random\Folder >START dailybackup

or, if you opted for a shorter alias:

C:\Some\Random\Folder >START dbu
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .