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
pushd
cd /d c:\utils
dailybackup.exe
popd
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
2On Windows, environment variables are delimited by surrounding percents, i.e.
%PATH%
, not a preceding dollar sign. – Hello71 – 2010-08-09T21:10:53.263