Skip to content

Instantly share code, notes, and snippets.

@Demiu
Last active May 10, 2024 08:51
Show Gist options
  • Save Demiu/2a41441a67fedb7fab20bc0696b5c8f5 to your computer and use it in GitHub Desktop.
Save Demiu/2a41441a67fedb7fab20bc0696b5c8f5 to your computer and use it in GitHub Desktop.
How to properly move AppData in Windows 10

Moving AppData folder on Windows 10

  1. Create a new user with administrator permissions
  2. Sign out of the current user and sign in as the newly created user
  3. Navigate to C:\Users in File Explorer
  4. Click into the account you want move AppData from
    • There could be a popup telling you that you need to allow yourself to access that user's data, do so
  5. Cut the AppData folder
    • If invisible, go to View and check Hidden Items
  6. Paste in the desired location
    • Some errors will show up:
      • exe's with size of 0 will pop up errors 0x80070780 "This file cannot be accessed", skip them
      • tbres' and other various files will pop up saying they shouldn't be moved and are you sure, always yes
  7. Wait for the operation to finish
  8. Navigate back to the AppData location before the move
  9. Delete the old folder
    • It contains those exe's that couldn't be accessed, they can be deleted though
  10. Launch Command Prompt as admin
    • I recommend ctrl+R, typing cmd and ctrl+shift+enter
  11. Navigate to the User folder of the moved account
    • cd ..\..\Users\Account_name_here
  12. Create a junction named AppData to the moved folder location
    • mklink /j AppData "Z:\Path\To\New\AppData"
  13. Log out of the new user, log back in as the user with the moved AppData
    • Start menu will not work, throw an error and ask you to sign out to fix it, that won't work, ignore it
  14. Start powershell as admin
    • Same method as with cmd
  15. Fix the UWP packages
    • Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
    • This will fix the start menu by adding back the applications you "deleted" in step 10
    • Some packages may fail because a newer version is already installed, that's not a problem
    • Some may fail because on the new user the packageds cannot be installed while they're running (notable: StartMenuExperienceHost), kill them:
taskkill /F /IM explorer.exe
taskkill /F /IM SearchApp.exe
taskkill /F /IM SearchUI.exe
taskkill /F /IM ShellExperienceHost.exe
taskkill /F /IM StartMenuExperiencehost.exe
  1. Sign out, restart, sign back back in
  2. Delete the user created in step 1
  3. Some packages may still be broken, you may fix them as needed
    • Get-AppXPackage *WindowsStore* -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
    • Replace the WindowsStore with name of various UWP apps that break
@n4n0lix
Copy link

n4n0lix commented Oct 9, 2023

Coming back to this after 8 months: There was a Windows Update that broke all UWP applications for me (Calculator, Photos, Cortana, Microsoft Store, etc.). Sadly I didn't find any solution to it but also just looked for a couple of hours and then replaced the apps with alternatives and moved on. But for future readers this might be something you have to accept.

That might also be what broke the Phone Link App for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment