set path variable in xp so C++ compiler program can run in dos and go to any directory.

Posted on 2006-04-22
Medium Priority
Last Modified: 2010-04-13
I opened a C++ compiler program in the DOS enviornment. I went to command prompt and copied files that I was supposed to off the CD. All that went well. Opened directory and copied files to it. Well, the C++ program does not work. I think that I need to set the Path in xp. I tried doing this once and messed up and had to get a fix it program that I downloaded. Is their any way I can set the path in DOS? I read that you can, or can I set a totally new path in enviornment variables? As long as the original path is there will this C++ program look for multiple paths then pick the one that works. I would rather not mess with the original path set by windows. thanx.
Question by:killion211
LVL 32

Expert Comment

ID: 16517599
You can see what path you're currently using by typing "path" at the command prompt in your "dos" window.

To set the path, you better off doing the following:

 Start -> Control panel -> System -> Advanced -> Environment variables

and then select the variable "Path" and click on edit etc.

Of course, you have to know what you want to make the path first. This depends a lot on which C++ compiler you're using.
LVL 10

Accepted Solution

GuruGary earned 750 total points
ID: 16522220
If you don't want to change the original path set by Windows, there are a few ways to change just the command prompt path.

You can see the current path with the PATH command.

If you want to add to the end of it use something like:
set path=%path%;C:\New\Path

If you want to add to the beginning of the existing path, use something like:
set path=C:\New\Path;%path%

Or if you want a brand new path use something like:
set path=c:\windows\system32;C:\New\Path;C:\Compiler

You can manually type these in which will be in effect until you close the command prompt, or put them in a batch file to run when you need them, or add them to the autoexec.nt to automatically run each time you run the command prompt.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Applications for our next round of the Experts Exchange Scholarship Contest are starting to roll in. It made us wonder what our past winners are up to these days. Here's a look at what four winners experienced with the contest and what they're doing…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month17 days, 8 hours left to enroll

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question