0
xcopy /E /V /I /F /Y "C:\Program Files (x86)\Diablo III" "H:\programs\Diablo III"
cmd /C rd /S /Q "C:\Program Files (x86)\Diablo III"
cmd /C mklink /J "C:\Program Files (x86)\Diablo III" "H:\programs\Diablo III"

This is what steam mover uses when moving program to another folder.

Why uses xcopy? What's wrong with regular copy or move command?

Why does cmd /C mklink /J "C:\Program Files (x86)\Diablo III" "H:\programs\Diablo III"

Why not just do

mklink /J "C:\Program Files (x86)\Diablo III" "H:\programs\Diablo III"

That sort of thing Why prepend the command with cmd /c?

I know rd is a command. I have no idea what cmd is.

4
  • 3
  • It seems that cmd.exe is command prompt itself. Why does cmd bla bla why not go straight doing mklink /J
    – user4951
    Apr 27, 2016 at 20:18
  • <shrug> No obvious reason springs to mind.
    – DavidPostill
    Apr 27, 2016 at 20:29
  • Please note that these symlinks/junctions may break when updating a program/game, leaving the program/game in an unusable state. Happened to me with Visual Studio, had to reinstall Windows because it's deeply rooted.
    – Daniel B
    Apr 27, 2016 at 20:45

1 Answer 1

3

Step 1: Copy everything regarding D3 from C:\program files to H:\program files

Step 2: Since we copied everything off of the C drive, delete the program from C:\program files

Step 3: Create a Symbolic link using a directory junction. This creates an alias between the 2 directories. So, if the blizzard launcher is looking for C:\program files\d3, it will be forwarded to h:\program files\d3. This step is important so that other applications do not have to look in the new place for the files.

xcopy is able to copy folder hierarchies and copy is intended for just files (usually).

So, what you have here is:

xcopy 
/E (Copy folders and subfolders) 
/V (Verify that the new files were written correctly) 
/I (If in doubt always assume the destination is a folder, e.g. when the destination does not exist.) 
/F (Display full source and destination file names while copying.) 
/Y (Suppress prompt to confirm overwriting a file.)
from c:\program files\d3
to h:\program files\d3
_____

cmd (Start a new CMD shell and (optionally) run a command/executable program.)
/C (Run Command and then terminate)
rd (remove directory (delete the folder we are about to specify))
/S (Delete all files and subfolders in addition to the folder itself. Use this to remove an entire folder tree.)
/Q (Quiet - do not display Y/N confirmation)
for the old game directory c:\program files\d3
______

cmd (Start a new CMD shell and (optionally) run a command/executable program.)
/C (Run Command and then terminate)
mklink (Create a symbolic link to a directory or a file, or create a hard file link or directory junction.)
/J (Create a Directory Junction.)
between C:\program files\d3 and h:\program files\d3
4
  • why the cmd /c?
    – user4951
    Apr 28, 2016 at 1:48
  • There really is no reason for it. Not including it would yield the exact same result. It looks flashier because you get more windows to automatically open and close, but that's it.
    – Narzard
    Apr 28, 2016 at 13:24
  • @JimThio btw, stoked for season 6 tomorrow?
    – Narzard
    Apr 28, 2016 at 13:33
  • I am viewing season 5 game of throne thanks :) @narzard
    – user4951
    May 4, 2016 at 9:58

You must log in to answer this question.

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