Working with hardlinks

hardlinks can be quite handy if you want to sort files like images for example. there are many that you do not fit in only 1 category. instead of putting identical copies in 2 folders and thus wasting space and producing possible inconsistencies you can use hardlinks.
you can do this in dopus with this command: copy MAKELINK=hardlink

but this doesn't solve all inconsistency issues. if you want to rename or delete a file you had to know how many other hardlinks exist, where they are and then change or delete them too. to solve this i made these 2 commands:

rename all hardlinks to the name of the selected file

@admin
@runmode:hide

fsutil hardlink list {filepath} > hardlink_batch.tmp

for /F "tokens=*" %%A in (hardlink_batch.tmp) do rename "{filepath|\}.%%A" {file} 
del hardlink_batch.tmp

delete all hardlinks (no recycle bin)

@admin
@runmode:hide

fsutil hardlink list {filepath} > hardlink_batch.tmp

for /F "tokens=*" %%A in (hardlink_batch.tmp) do del "{filepath|\}.%%A" 
del hardlink_batch.tmp

warning: both use batch commands and that can cause problems with unicode characters (didn't test that yet)