2

I've created a fairly large RAM disk and was wondering whether it is possible to move C:\Program Files directory there?

3
  • 3
    Would that be useful? Wouldn't copying all those files every time you reboot take longer than the occasional wait until all those files are cached anyway? Mar 10, 2010 at 17:16
  • Need more details on how your RAM disk will work - will it cache to disk on shutdown? Will it be powered long term? Mar 10, 2010 at 17:43
  • @user26453, @Andrew J. Brehm. Yes, the RAM disk caches all the data at shutdown and brings it back up at load. It actually works pretty darn fast. Mar 10, 2010 at 17:46

3 Answers 3

3

If you go to the registry, and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion, there are one (or two on 64-bit versions) keys there: ProgramFilesDir and ProgramFilesDir (x86) (on 64-bit versions).

You can change these to point where ever your heart desires.

Keep in mind the info people above have said about your RAM disk being persistent or not, and also be aware that SOME programs do not behave properly if your program files directory is moved. There shouldn't be too many that have problems with it at this point, but some older programs (or poorly written ones) may.

2
  • 2
    All applicable disclaimers about the potential dangers of editing your registry apply. :)
    – eidylon
    Mar 10, 2010 at 18:24
  • I suppose Windows is poorly written then ;) Because changing the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir value (I presume this applies to the ProgramFilesDir (x86) - Is there a space in there? - too) is not supported or recommended, per a MS KB. Seems to cause issues with a whole host of Windows functionality / code (SFC, Updates, etc)
    – user66001
    Oct 20, 2013 at 19:38
1

Assuming your RAM disk is persistent, I suppose you could move everything over there and set up a symbolic link from the c:\ folder to the RAM drive's folder. mklink can create that symbolic link for you.

2
  • or junction to make the link, it seems to work well particularly for moving directories from where Windows expects them Mar 10, 2010 at 19:32
  • Note what MS says about the practice, in my comment, above
    – user66001
    Oct 20, 2013 at 19:39
1

No, it is not possible to move %ProgramFiles% out of the system drive and still have a working installation. The reason is that there are system files in there, and for proper servicing they need to be hardlinked with the ones in %SystemRoot%\winsxs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .