Quick Robocopy question

Askys 20 Reputation points
2024-10-26T15:27:25.5466667+00:00

Hello there, was wondering if someone with knowledge could let me know if this works.

I'm trying to clean up my C: drive a bit, so i'm moving programs to another drive. Ive moved all i can with the "Move" option, and the apps that allow you to reinstall them with a directory. as well as the apps that are in the Program Files folders over to the new drive with the RoboCopy command.

However there are some apps that like to install themself inside the Appdata folder. Can i still move those apps using Robocopy? I've been using these 2 commands for the other programs.

robocopy "C:\Program Files\XXX" "D:\Programs\XXX" /sec /move /e

mklink "C:\Program Files\XXX" "D:\Programs\XXX" /j

so this step would be something like.

robocopy "C:\Users\XXX\AppData\Local\XXX" "D:\Programs\XXX" /sec /move /e

mklink "C:\Users\XXX\AppData\Local\XXX" "D:\Programs\XXX" /j

The "Appdata" folder is spooky, heard rumors some programs really don't like to be outside of it, or that it will just "install" itself back in there leaving you with double copies. So just want to make sure it wont break something.

Many thanks!

-Rasmus

Windows for business | Windows Client for IT Pros | User experience | Other
{count} votes

Accepted answer
  1. Marcin Policht 49,715 Reputation points MVP Volunteer Moderator
    2024-10-26T17:28:31.2+00:00

    You’re correct - unlike programs in C:\Program Files, those in AppData are often designed to reside there specifically due to their relationship with user profiles. Moving them could potentially cause issues, including unexpected behavior or the software reinstalling itself in AppData after a restart.

    Potential issues relate to:

    1. Applications tied to user profiles: Many programs store user-specific settings, temporary files, and caches in AppData. Moving these could confuse the application.
    2. Hard-coded paths: Some apps rely on specific hard-coded paths (e.g., C:\Users\XXX\AppData\Local\XXX). If these files are moved, the app might crash or recreate them.
    3. File permissions: The permissions of AppData files are typically aligned with the user's profile. Moving them could lead to permission mismatches.
    4. Automatic regeneration: Some applications will detect missing files in AppData and recreate them, leading to duplicate data and clutter.

    Your suggested approach of using junctions should work - but in case it fails, you might try:

    1. Performing a selective move:
      Move large cache or temporary data only. Some apps store non-essential data (e.g., logs or cache) in AppData. You can move only these subdirectories if identified.
    2. Using backup for large files:
      If your goal is disk space optimization, try tools like WinDirStat to identify large folders in AppData and back them up or archive them externally.
    3. Cleaning up AppData by relying on utilities designed to address the issue you're dealing with:
      Run built-in tools like Disk Cleanup or use CCleaner to remove unnecessary files from AppData without breaking anything.
    4. Reconfiguring the apps (if supported):
      Check if the app offers configuration settings to change the installation or data path (some apps allow you to store cache in custom locations).

    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.