How to create a symbolic link using a script package on Windows?

I am currently using the following script to copy all files with a specific prefix to the target directory:

for /f "delims==" %%k in ('dir "d:\Search Path\File Prefix*.*" /s /b') do copy "%%k" "d:\Target Directory\" 

This works fine, but I would like to instead create a symlink to files containing any file changes. Can someone advise how I can do this?

Thank you very much

+6
source share
1 answer

You use the mklink :

 for /f "delims==" %%k in ('dir "d:\Search Path\File Prefix*.*" /s /b') do ( mklink "d:\Target Directory\" "%%~k" ) 

And that should solve your problem. mklink /? for more information.

Mona

+5
source

All Articles