guide · static export
PC · storage

Move a Program to Another Drive with a Junction

Some installers refuse to pick a different folder. Move the installed folder with robocopy, leave a directory junction behind and the program keeps working from the new drive without a reinstall.

by@guidox updated:10/31/26 time:20 min level:Intermediate tested on:Windows 11 24H2 works on:Windows 10, Windows 11 tools:Command Prompt as administrator, PowerShell
TL;DR

Close the app, move its folder with **robocopy /MOVE**, then create a link with **mklink /J** at the old path. Windows follows the junction, so shortcuts, registry paths and updates still resolve.

Before you start

Requirements

  • Admin rights
  • The program folder and its target drive
  • 20 minutes
Step by step

Instructions

01

Check that the folder is not locked

A running process keeps a handle open and robocopy will skip files. **Get-Process** filtered on the executable name finds the obvious culprits before you start moving gigabytes.

Get-Process | Where-Object Path -like 'C:\Program Files\HeavyApp*' | Select-Object Name,Id,Path
Stop-Process -Name HeavyApp -Force -ErrorAction SilentlyContinue
02

Measure what you are about to move

Size and file count decide the time and whether the target has room. A junction does not copy anything, so the free space check is about the destination only.

$src = 'C:\Program Files\HeavyApp'
'{0:N1} GB in {1} files' -f ((Get-ChildItem $src -Recurse -File | Measure-Object Length -Sum).Sum / 1GB), (Get-ChildItem $src -Recurse -File).Count
Get-Volume -DriveLetter D | Select-Object DriveLetter,SizeRemaining
03

Move the folder, do not copy it

**robocopy /MOVE** copies the tree, verifies it and deletes the source only when the copy succeeded. That behaviour is why it is safer than cut and paste for a program folder.

robocopy "C:\Program Files\HeavyApp" "D:\Apps\HeavyApp" /MOVE /E /COPYALL /R:2 /W:2 /NP
Test-Path 'D:\Apps\HeavyApp\HeavyApp.exe'
Test-Path 'C:\Program Files\HeavyApp'
04

Create the junction at the old path

**mklink /J** needs the original path to be gone and the target to exist. The result is a real directory entry that the file system resolves transparently.

cmd /c mklink /J "C:\Program Files\HeavyApp" "D:\Apps\HeavyApp"
dir /AL "C:\Program Files"
Get-Item 'C:\Program Files\HeavyApp' | Select-Object Name,LinkType,Target
05

Test the program and its updater

Start the app, let it update, then confirm the new files landed on D. A junction that resolves correctly still writes through to the real folder, which is exactly the point.

Start-Process 'C:\Program Files\HeavyApp\HeavyApp.exe'
Get-ChildItem 'D:\Apps\HeavyApp' | Sort-Object LastWriteTime -Descending | Select-Object -First 5 Name,LastWriteTime
06

Remove the junction the safe way

**rmdir** deletes the link only. **del** or Explorer delete on a junction can empty the target folder on older builds, so use the command line.

cmd /c rmdir "C:\Program Files\HeavyApp"
Test-Path 'D:\Apps\HeavyApp\HeavyApp.exe'
Test-Path 'C:\Program Files\HeavyApp'
⚠ warningNever format or clean the target drive while a junction points at it and the app is installed. Uninstall first, then remove the link.
Troubleshooting

Common issues

mklink says the file already exists

robocopy /MOVE left an empty folder behind. Remove it with rmdir, then run mklink again.

The program starts but cannot find its data

Something hard-coded the new path. Point the app back at the original path; the junction makes the location irrelevant only if the app uses the old string.

The update reinstall breaks the link

An installer that deletes and recreates the folder removes the junction. Recreate it with mklink after the update, or install the app to the target drive directly next time.

Antivirus flags the junction

Some scanners follow reparse points and scan the target twice. Exclude the target folder, not the link, if scan time becomes a problem.

FAQ

Frequently asked

Is a junction the same as a symbolic link?

No. A junction exists only for directories and resolves on the local volume; a symbolic link can point to files, UNC paths and even non-existent targets, and it needs admin rights or developer mode to create.

Can I move a program that is registered with the uninstaller?

Yes. The registry entry still names the old path, which now resolves through the junction, so uninstall works normally.

Why not change the drive letter instead?

Changing a letter moves every program on that volume and breaks shortcuts and services. A junction touches one folder and nothing else.

How to undo this

Close the program, remove the junction with cmd /c rmdir, then move the folder back with robocopy /MOVE from the new drive to the original path. Start the app once to confirm it runs from its original location.

Changelog · 1 entry
  1. 2026-10-31
    First version
Interactive version: checklist, feedback, related guides →

Free · no account needed · tracks your progress