XP: Change Default Installation Directory

Posted November 30, 2003 by AlexTheBeast in Windows

This recipe will change the default location where Windows installs programs.

I utilize two hard drives because I want to keep my main drive running efficiently, with mainly just the OS running. I install the majority of my programs on my second drive.. However, Windows always wants to install programs to “c:\program files” and changing it every time can be time consuming.

After you back up your registry, this is how you can change this default location.

1. Navigate to the following:
2. Find ProgramFilesDir whose default should be C:\Program Files
3. Change this to whatever directory you wish. I changed it to D:\Program Files for example.

Remember you have to reboot for your changes to show.

The Conversation

Follow the reactions below and share your own thoughts.

  • nagaraj

    Nice to know

  • max

    thank you thank you thank you

  • Tom

    It always says that there was an error when modifying it. Could this have to do with administrative privileges?

  • Anonymous

    Very Nice Thankyou, was looking for a while but your instructions are simple and easy to follow, Good Job.

  • Thnx! this was EXACTLY what I was looking for!

  • Anonymous

    What if you want it to default to the current user’s profile? Would this work?

    %USERPROFILE%Program Files

  • Anonymous

    Does this mean I can put some programs on a memory stick – my Dell Mini 9 has almost o room left on it’s tiny 8GB SSD ! It would be great to have some other programs available if I could somehow install them onto the memory card yet still get their ICON to show on desktop or in the PROGRAMS list.

  • Anonymous

    what do you do w/ the ProgramFilesPath that formerly listed %c:program files% after changing the above?


  • Anonymous

    Thank you very much!!! This is very useful to me.

  • Name

    I tried this on windows 7 in my case it works….sorta because whenever i install something new it installs it to my “D:” drive in the program files there but the short cuts in the start menu still revert to the C: drive for whatever reason….I’m looking into it but i’m not sure where to start… any help would be appreciated greatly. NOTE : Error “C:Program FilesProgramNameHereProgram.exe
    The specified path does not exist.
    Check path name, and then try again”
    I have manually reset the shortcut in the start menu and then “tried again” to have it work but doing this for every program is a hassle and unexceptionable in the long run once again any help would be great.

  • Name

    Disregard my last comment…I forgot to reboot after edit the registry. All fine after a reboot. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  • Cedo


    Tells you MS doesn’t support the change for a few reasons that are listed in the article. However, it also tells you how to do it. If you don’t mind being experimental, I say give it a shot.

  • Anonymous

    my problem is probably simple to fix but, when i was about to install something, i accidently click ‘open with’ then picked ‘winrar’ is there away to fix this?

    • Anonymous

      meaning, when everything i download, always has that winrar logo, and won’t install properly

  • Jack Richard

    Thank you very much.

  • Anonymous

    Hello, to anybody that looks at this and can possibly solve my problem. I realize that this changes the default installation directory for programs you download off the internet. What I desperately and dearly need to know is how to change it for a CD. If anyone has the answer, I would be very greatful if you could tell me. Thank you.

  • fatemeh

    Thank you so much ! It helped me a lot !!!

  • lewis

    hey this would fix all my problems but i tried to do it i cant find any file called programfiledr in program files in my c: drive , i use windows xp but i cant find that file , is there somewere else it could be ?

  • Benallott

    keep in mind this will move all shortcuts of already installed programs
    so go to (original location):Program Files and copy all the (New Location):(Folder Name)

    e.g. (old) C:Program Files -> D:Me App Files

  • Josejijo172

    thkzz man u r my hero

  • Just wondering if the two hard drive idea works with a hard drive that’s partitioned or if it has to be two separate pieces of hardware. I’m thinking about doing this but if it only keeps things faster when it’s two separate pieces of hardware, then I can’t do it right now.

  • Phil

    Great information. Thank you.

  • adam

     I got this working on Windows 7 64 bit. Here’s what I did:
    In addition to the registry keys in HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersion you also need to change the ones in HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersion.
    Then, you need to copy all the files in c:Program files (x86) and c:program files to where ever your new locations are. Then don’t delete the original directories, since not all programs are smart enough to make the switch.
    Obviously, this works best on a fresh install where the program file directories are only a few hundred megabytes.
    Any (well, most) new programs you install will figure out that your new location is the default program files directory.

  • shruthi

    hey, i did al the above. But when i changed the drive to other drive n restart the system n tried to install the softwares . . Its showing the path cannot be found n the regedit also not opening. Its showing windows cannot find the regedit. . Wat to do ?

  • ken

    Strange thisng is that when I go in to regedit and then to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion

    all that is in there is a key saying default not set

  • Dhiraj

    Thnxx……this helped even without rebooting

  • Alza

    I tried this alteration in the registry with no success at all. Changed the program file directory and restarted but OCR installs merely in the default c drive and not in the E drive as sought. Did I miss any other point?