Shoelaced
Shoelaced

Reputation: 881

Bulk symlink all files in one folder to another folder (Windows)

I have Folder A that contains a bunch of sub folders, and I would like to symlink all of those subfolders into Folder B without having to go through and individually mklink each one of them manually. Is there a way I can bulk symlink the entire contents of Folder A into Folder B? I don't need any qualifiers or exclusions, like others who have asked about bulk symlinking, I just want all of Folder A to appear inside Folder B, such that I can also add other things to Folder B.

Upvotes: 0

Views: 2446

Answers (1)

Shoelaced
Shoelaced

Reputation: 881

Figured it out. Created my first Windows Batch File! Never knew they were a thing, but this seems to be working:

echo off
for /f "usebackq delims=|" %%f in (`dir /b "C:\path\to\source\directory"`) do (mklink /d "C:\path\to\destination\directory\%%f" "C:\path\to\source\directory\again\%%f")
pause

Upvotes: 1

Related Questions