Moving Windows 7 ProgramData folder after installation

4

3

I need to move my C:\ProgramData folder in a Windows 7 installation to D:\ProgramData.

I understand how to make the symlinks and registry changes so this works. My problem is that I'm unable to copy the files in the ProgramData folder because the OS seems to have some of them locked.

Specifically, the files in the C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys folder are blocking the move.

Am I out of luck here? Is there any way to move the folder, create the symlink, and update the registry without any of the files in these folders being locked?

thinkzig

Posted 2009-12-17T12:22:14.553

Reputation: 141

See: https://support.microsoft.com/en-in/kb/949977

– Dheeraj V.S. – 2016-07-04T07:25:52.523

Aside from doing it off-line (i.e. remove the drive and do it on another machine), I don't think this is possible. – None – 2009-12-17T12:49:37.923

Could you expand on "doing it off-line"? Right now I have 2 drives, an SSD that has win7 on it and a normal drive that has XP on it. In other words, I can still boot into the XP drive and copy the ProgramData from the win7 drive onto the winXP drive without locking issues.

My question is: if I do this and go in and change the registry settings on 7, will I risk rendering the win7 installation useless? – thinkzig – 2009-12-17T13:23:41.777

Answers

4

Move the Profile and ProgramData

start from Windows 7 DVD and choose to repair Windows, open Command Prompt (CMD) and type:

move the "Users" folder to the second partition by this command.

  1. ROBOCOPY "C:\Users" "D:\Users" /COPYALL /MIR /XJ.

move the "ProgramData" folder to the second partition by this command.

  1. ROBOCOPY "C:\ProgramData" "D:\ProgramData" /E /COPYALL /MIR /XJ.

delete the "Users" folder from C: partition.

  1. RMDIR "C:\Users" /S /Q

make Junction link to Profile folder in second partition.

  1. MKLINK /J "C:\Users" "D:\Users"

delete C:\ProgramData (ignore any failed massage)

  1. RMDIR "C:\ProgramData" /S /Q

open the Registry Editor and change the profile values to the new path.

  1. REGEDIT.

navigate to this path: HKEY_LOCAL_MACHINE -SOFTWARE -Microsoft -Windows NT -CurrentVersion -ProfileList and change the values to the new path.

after windows restart open CMD as Administrator and delete C:\ProgramData

  1. RMDIR "C:\ProgramData" /S /Q

make Junction link to ProgramData folder in second partition.

  1. MKLINK /J "C:\ProgramData" "D:\ProgramData"

Aharon Don

Posted 2009-12-17T12:22:14.553

Reputation: 41

1

Caveat: I've never done what you are asking before, but...

You can get easily get around the copy problem by down loading a Linux Live CD such as Ubuntu, and booting from it. You will be able to access your drive, and copy the folder from one location to the other.

When you reboot you can make the registry changes, reboot, and thereafter you ought to be able to delete the original.

CJM

Posted 2009-12-17T12:22:14.553

Reputation: 2 512