In Windows 7 and Windows 8 a lot of programs are automatically installed into the Program Files folder by default. If you’re using a tool like Ninite to deploy programs across multiple clients, the only way to change where programs are installed is to change the default installation folder of Windows itself. All it takes to do this is a quick registry fix.
Open the Start Menu and type: regedit. Then click the program/app link that comes up.


Browse to the following registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion and HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion
On a 64 bit system there will be two entries, “ProgramFilesDir” and “ProgramFilesDir (x86)”.

Double-click one of these entries and type in the desired directory you would like programs to install to by default. Click OK to save changes and exit.

Now all it takes to apply the registry changes is a restart. Once the reboot is finished Windows will automatically install all future programs to the directory you’ve specified in the registry key. Note that if you changing this registry entry may cause some programs that are already installed to no longer function properly. The workaround is to copy and paste all of the files within the original directory into the new one.

Thankyou so much, everywhere else was only saying about the first regedit directory so nothing worked, lifesaver.
Have to agree with the other comment, all of the other solutions were deficient. Thanks for the great info!
after following this suggestion I cannot access regedit anymore…