How do I add an environment variable so I can run an EXE from any folder in the Windows command line?
I went to Environment Variables in the Advanced tab of System Properties and added a new System variable like this:
name: msbuild35
value: C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe
but when I try to run msbuild35 I still get the 'not recognized...' message
What am I missing?
Solution 1:
You need to add ;C:\Windows\Microsoft.NET\Framework\v3.5\
to the end of the PATH environment variable.
You will likely need to close and reopen your command line window for the changes to take effect.
Solution 2:
Open the Environment Variables dialog from the Advanced tab of System Properties again and do the following.
- Delete msbuild35 that you created earlier; it is not necessary
- Look for the
Path
variable in both sections (user and system) - If there is one in the user section, please let us know since that is unusual
- Select the
Path
variable from the System Variables section and click Edit - Look for
C:\Windows\Microsoft.NET\Framework\v3.5
in the value field of the dialog (you may want to copy the contents of the field to Notepad to make it easier to examine) - Verify that there is a semicolon before it, and if it is not the last item, after it as well
- Click OK, OK, OK
- Reboot
- Open a command prompt and type
msbuild
- Let us know if it still does not work