0

I want to copy C:\Program Files to D:\Programs and place a junction instead.

If I run robocopy "C:\Program Files" D:\Programs /e /copyall /sj /secfix from WRE or any other external environment everything gets copied but Windows becomes corrupted (for instance I can't open any UWP apps).

I tried to robocopy to another folder on the same drive but the problem persists, so the issue lies in the copying procedure itself and not into the change of partition.

I fear there is a problem with permissions, since if I just rename the C:\Program Files folder to something else and place a junction to it everything works fine.

How can I make an exact copy of everything inside C:\Program Files?

10
  • One problem you will face is the fact you should not, specifically, be able to move the WindowsApps directory without actually breaking UWP applications. Since that directory exists within Program Files, however, you should be able to create a folder on your desired drive and simply install applications to that directory. I just typically just change the drive letter at the installation of programs and it works fine.
    – Ramhound
    Commented Dec 12, 2023 at 1:05
  • If your goal is space savings, there's other directories that can more more easily. I've done folder redirects for space savings in Windows for a long time, and as I recall, it's never worked for Program Files without severe consequences, intended or not. Commented Dec 12, 2023 at 1:21
  • @Ramhound it just seemed more neat to me having everything in one place. Isn't there any way I can make the copy work? Commented Dec 12, 2023 at 2:31
  • @music2myear thank you for sharing. It is just frustrating that I can't understand goes wrong in the copying process Commented Dec 12, 2023 at 2:32
  • @PellegattaSimone - You don’t have permissions to the WindowsApps folder contained within Program Files.
    – Ramhound
    Commented Dec 12, 2023 at 2:33

2 Answers 2

1

This would be generally dangerous to do and I suggest you do not move it.

Windows expects Program Files to be on drive C for its many installs.

As you have seen, there are permission issues from tying to move it.

It's size is less than 10 GB on my machines, so I suggest finding neutral files (My Documents) to move. This can be moved safely.

2
  • It's not a space problem: since I often need to reset the computer, I need a way to avoid having to reinstall all the programs even in the absence of backups. Furthermore, the fact that I can edit the %ProgramFiles% path at HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion means that it is supported by Windows Commented Dec 12, 2023 at 2:24
  • I often need to reset the computer, I need a way to avoid having to reinstall all the programs even in the absence of backups. ...... Copying Program Folders will not help with this. Some install parts are in the registry and some are in the Users folders. This is not a good backup avoidance plan. Work up proper backups instead.
    – anon
    Commented Dec 12, 2023 at 2:31
1

Answer is no, you can not move "Program Files" to another drive on installed Windows.

There is a way to do this, but can be done only during installation of windows, and it's not really an easy feat since it still requires quite a bit of modding of answer file and registry keys.

And to brake the barrier for rest of folders(and ideas), in essence you can have each and every folder, that is currently in your C drive, in their own drive and have C drive empty totally, but this can never be achieved on installed Windows.

7
  • Could you describe me or link a tutorial on how to achieve this? Commented Dec 14, 2023 at 6:06
  • I cant find the tutorials that I used for guidance(was some time ago), but one of guides you can find at; Method 1: Migrate program files to another drive using Registry Editor(ubackup.com/backup-restore/…) ...and you might use this page (codium.com.au/blog/moving-users-program-files-in-vista) to get idea what all you must change in reg. In any case to that on as clean Windows as possible, then install your apps, also keep in mind that most apps by default will install to C(not %systemdrive%) and VSs,ADKs must be on C:\
    – Danijel
    Commented Dec 14, 2023 at 7:59
  • I was going to accept your answer, but I tried both tutorial and they do not work since they use robocopy which breaks WindowsApps as explained in my question. Is there any alternative way to move files? Commented Dec 14, 2023 at 13:36
  • You need clean install of Windows, make D:,use LiveOS then robocopy program files, then edit hive for installed Windows(regedit) by editing every single string/key that mentions "C:/program " and replace it with your "new" program files folder path, and then proceed with OS as usual. Dont forget %sysVariables%. Editing already installed windows that has ton of apps, is next to impossible. You cant move any system folder/file while running on that system, its locked/used.To do any of it, use liveOS. CleanWin=less reg path changes. This is advanced change and itll faill till you get paths right.
    – Danijel
    Commented Dec 14, 2023 at 16:34
  • I have already done everything else... The problem lies within robocopy, which corrupts WindowsApps folder Commented Dec 14, 2023 at 17:18

You must log in to answer this question.

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