Last active
October 23, 2024 04:11
-
-
Save EldonMcGuinness/35e51ab97bb5fb1089db0de4f79b5b14 to your computer and use it in GitHub Desktop.
Recursive link folder and files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
chcp 65001 >NUL 2>&1 | |
SET dst=%~1 | |
SET src=%~2 | |
if exist "%dst%/" ( | |
echo Your Destination Already Exists! | |
goto done | |
) | |
if not exist "%src%/" ( | |
echo Your Source Does Not Exist! | |
goto done | |
) | |
mkdir "%dst%" | |
for /D %%A in ("%src%\*") do ( | |
mklink /D "%dst%\%%~NA" "%%~A" | |
) | |
for %%A in ("%src%\*") do ( | |
mklink "%dst%\%%~NXA" "%%~A" | |
) | |
echo Done! | |
:done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment