Is there a way to move c:\program files elsewhere?

2

1

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

AngryHacker

Posted 2010-03-10T17:10:54.927

Reputation: 14 731

3Would 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? – Andrew J. Brehm – 2010-03-10T17:16:47.550

Need more details on how your RAM disk will work - will it cache to disk on shutdown? Will it be powered long term? – mindless.panda – 2010-03-10T17:43:12.010

@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. – AngryHacker – 2010-03-10T17:46:08.650

Answers

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.

eidylon

Posted 2010-03-10T17:10:54.927

Reputation: 1 667

2All applicable disclaimers about the potential dangers of editing your registry apply. :) – eidylon – 2010-03-10T18:24:20.977

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 – 2013-10-20T19:38:30.537

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.

Jeff Shattock

Posted 2010-03-10T17:10:54.927

Reputation: 1 798

or junction to make the link, it seems to work well particularly for moving directories from where Windows expects them – mindless.panda – 2010-03-10T19:32:50.007

Note what MS says about the practice, in my comment, above

– user66001 – 2013-10-20T19:39:56.497

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.

kinokijuf

Posted 2010-03-10T17:10:54.927

Reputation: 7 734