Wednesday, 9 March 2016

Create hard links for multiple files in batch process

If you need to create hard links for multiple files in one folder you can use the following batch script:

@ECHO OFF

set source_path="C:\Data\Hansa\Befliegung\Mosaic_rgb\"
set source_filter="*.tif"
set target_path="C:\raster\2013\"

for  %%i in (%source_path%%source_filter%) do (mklink /h %target_path%%%~nxi %source_path%%%~nxi)

pause

The script needs to be run with Administrator privileges.

No comments:

Post a Comment