Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This question already has an answer here:

I have an SSD as my main Windows drive, with a 640GB 2.5" HDD, partitioned to store programs and user settings, and also to act as backup (it's the only thing I had lying around at the time of building my PC).

The task was to make the PC as fast as possible, while having an increased storage capacity available to store normal user data, and to assist in my small data recovery business.

The problem is that whenever I install a program, it installs to C:\Program Files [(x86 for the 32 bit programs]\, although I have changed the environment variables. This wouldn't normally be an issue, however every installation program points its shortcut to my 640GB HDD.

The root layout of both drives: root layout

To clarify:

  • Program files get installed to C:\
  • Program shortcuts are always pointed to Z:\, my 640GB HDD

Modifying the relevant environment variables doesn't do anything, I looked at this, but however it only talks about modifying the registry and environment variables, which I have already done so.

I install to the Z:\ drive if the installation program lets me change the installation path, but however the installation programs sometimes don't let me change this.

Is there a way that I can force every program to install to the relevant location on Z:\? Perhaps I'm missing something here?

Edit: Found this program; would it be appropriate to use in my case? I would be able to move the entire Program Files (and its x86 version) to Z:\, without impacting on the performance.

share|improve this question

marked as duplicate by Ƭᴇcʜιᴇ007 Oct 12 at 18:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
@Techie007 The 'duplicate' doesn't answer my question. –  cybermonkey Oct 12 at 19:15

1 Answer 1

up vote 1 down vote accepted

System folders relocation

Is there a way that I can force every program to install to the relevant location on [a different drive or partition]?

Yes, there is. Keep in mind it's not officially supported, and can lead to unwanted side effects:

By changing the default location of the user profile directories or program data folders to a volume other than the system volume, you cannot service your Windows installation. Any updates, fixes, or service packs cannot be applied to the installation. We recommend that you do not change the location of the user profile directories or program data folders.

Source: Relocation of the Users directory and the ProgramData directory to a drive other than the drive that contains the Windows directory

Relocation of the "Users," "ProgramData," or "Program Files" directory is not supported in Windows 8 and will block operating system upgrades.

Source: You encounter an error when trying to install Windows 8.1 due to redirecting the Users or Program Files folder to another partition

Also:

Microsoft does not support changing the location of the Program Files folder by modifying the ProgramFilesDir registry value. If you change the location of the Program Files folder, you may experience problems with some Microsoft programs or with some software updates.

Source: Microsoft does not support changing the location of the Program Files folder by modifying the ProgramFilesDir registry value

If you understand that and want to continue anyway, make sure the destination is NTFS formatted, and that there's sufficient free space. Then follow these steps:

  1. Select the Repair Your Computer option through the advanced boot options you get by pressing the F8 key before Windows starts. If the option is not available, you'll need to boot using a Windows installation disc.

  2. Open the command prompt (also available by pressing Shift+F10), and retrieve the letter associated with the system drive by typing the following command and pressing Enter.

     wmic logicaldisk get caption,filesystem,size,volumename
    
  3. In case it doesn't exists already, create the destination folder. Replace the path below with the correct location.

    md "X:\Program Files"
    
  4. Copy all the data from the original folder to the new one. Replace D: with the letter of system drive you got in step 2, and then verify that all files were copied successfully.

    robocopy "D:\Program Files" "X:\Program Files" /copyall /xj /r:3 /w:10
    
  5. Rename the original folder to something different, e.g. Program Files.old.

    ren "D:\Program Files" "Program Files.old"
    
  6. Create a directory junction point pointing to the new folder location, adjusting the letters as needed.

    mklink /j "D:\Program Files" "X:\Program Files"
    

    Note The command will fail if the folder wasn't renamed, as per step 5.

  7. Repeat steps 3-6 for any other folders you want to relocate. When you're done, restart Windows. Ensure everything is working correctly, then delete the .old folders.

Further reading

share|improve this answer
    
-1 if I had the rep to do so.. I specifically said that I had done what you mentioned. –  cybermonkey May 17 at 18:24
    
@zyboxenterprises You mentioned the registry, and environment variables. You never said you created a junction point targeting the non-system drive. –  and31415 May 17 at 18:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.