Visual C/C++ directories

This is a discussion on Visual C/C++ directories within the Tech Board forums, part of the Community Boards category; Not really a programming question, so I put it here. How do you change what folder Visual C starts lookin ...

  1. #1
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145

    Visual C/C++ directories

    Not really a programming question, so I put it here.

    How do you change what folder Visual C starts lookin in when creating a new file? It always starts at:

    C:\Documents and Settings\#MyName#

    for me, which is kinda annoying. I want it to start at my programming folder:

    E:\Programming\Cpp

    The obvious place to find this would be TOOLS -> DIRECTORIES but it's not there, only directories for the headers and libraries.
    Suggestions?

    I'm using version 6.0 in WinXP pro.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Mine always has C:\ already there, and as I type in the name of the project it copies that, character by character into the Location field then creates that directory and puts the files there.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    It remembers that folder as long as Visual C is open, but if I restart it it goes back to the 'default' C:\Documents and Settings\#MyName#

    Oh, and this is for single files. It seems like the folders for projects works fine. It's when creating a new file when this happens.
    Last edited by Magos; 04-14-2003 at 12:07 PM.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  4. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    If I try to create New->File, the default path is C:\Program Files\Microsoft Visual Studio\Common\MSDEV98\bin\IDE. The fact that yours and mine are using a different path suggests it should be changeable, but I don't know how. It's not something I worry about, and hence, have never tried.

    If you find out, post it.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  5. #5
    Registered User
    Join Date
    Aug 2002
    Posts
    87
    In the case you are using Visual Studio 7.0 you might wish to open regedit and look under:

    HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\ 7.0

    There are some keys in there like the Defaults you could try to edit.

    If you are using Visual C++ 6.0 you open egedit and you editthe WorkspaceDir under:

    HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0 \Directories

    if you really want to have it it easy and without to much risk all you do is the following.

    1. Create a new file somewhere and call it dir.reg
    2. open it in Notepad
    3. input the following:

    Visual C++ 6.0

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Directories]
    "WorkspaceDir"="E:\\Programming\\Cpp"
    Visual C++ 7.0

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\7.0]
    "DefaultNewProjectLocation"="E:\\Programming\\Cpp"
    Please do note that i use Win XP and if you are not it is better to change the keys manually as the files might have a bit of a different effect under previous or future versions of windows

  6. #6
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    With VC++6, it always remembers the path I use for my programs (G:\C++). I don't know why yours wouldn't.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  7. #7
    Registered User
    Join Date
    Aug 2002
    Posts
    87

    Talking ...

    i spend about 30 mins looking through the registery to find those values so don;t tell me there is a easier way to do it!!!

  8. #8
    Registered User
    Join Date
    Aug 2002
    Posts
    87
    Oops only now saw that you were using 6.0 in a combo with pro =] so basically if u create a file called DefaultDir.reg, open it in Notepad and put the following in it:

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Directories]
    "WorkspaceDir"="E:\\Programming\\Cpp"
    or replace "E:\\Programming\\Cpp" with whatever dir you want it to be (make sure you use \\ instead of \) and then double click it and press OK you should be set for life =] (or atleast till you format).

  9. #9
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    The "VisualStudio/6.0/Directories" key didn't exist in regedit, nor did it have any effect when I added it. I found some string values directly under "6.0" like "DefaultFileOpenLocation", but changing those didn't have any effect either. Weird!

    I've attached some screenshots. When trying to create a new project it starts in my projects folder, which is correct. But when trying to create a new file it goes to "C:\Documents and Settings".
    Attached Images Attached Images  
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  10. #10
    Registered User
    Join Date
    Aug 2002
    Posts
    87
    I looked into it but i could not find any registery values that could possibly be linked to the create new file directory. My best advice would be to go with creating new files and then to add files to it, which would set the standard file location to the project folder.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 04:45 PM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 09:43 AM
  4. Errors with including winsock 2 lib
    By gamingdl'er in forum C++ Programming
    Replies: 3
    Last Post: 12-05-2005, 07:13 PM
  5. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21