How to delete Windows NTFS hard link (mklink /h) while original is in use?



As an IT administrator, you may have come across a situation in which you need to delete a Windows NTFS hard link (mklink /H) while the original is in use. This can be a tricky situation to deal with, as the hard link cannot be deleted while it is in use. In this article, we’ll look at how to delete a Windows NTFS hard link while the original is in use.

The first step in dealing with this situation is to identify the hard link that needs to be deleted. The hard link can be identified using the command line utility, mklink. This utility is available with Windows 7 and higher and can be used to create, view, and delete hard links. To view the hard link, open the command prompt and type ‘mklink /D ’. This will display the name of the hard link.

Once the hard link is identified, the next step is to delete it. To do this, use the command ‘fsutil hardlink delete ’. This command will delete the hard link, but it will not delete the original file. The original file will still remain on the system.

In some cases, the original file may be in use by another process, which prevents you from deleting the hard link. In this case, you can use the command ‘handle’ to identify which process is using the file. This command will list all the processes that are using the file. Once the process is identified, you can terminate it using the ‘taskkill’ command. This will allow you to delete the hard link.

It is also possible to delete a hard link while the original is open. To do this, you can use the ‘unlink’ command. This command will delete the hard link, but will not delete the original file. The original file will remain open, but the hard link will be removed.

In some cases, you may need to delete a hard link while the original is in use. In this case, you can use the command ‘fsutil hardlink delete /Force’. This command will delete the hard link, even if the original file is in use. However, this command should only be used as a last resort, as it can cause data loss or other system problems.

As an IT administrator, it is important to know how to delete a Windows NTFS hard link while the original is in use. This can be a tricky situation to deal with, as the hard link cannot be deleted while it is in use. However, by using the commands described above, you can safely delete the hard link while the original is in use.

Inquire Now

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Find your next full or part-time role here

ScaleDesk can either help you find your next full time gig or a part time side gig where you can create extra income!

Onboard with us once
Skip HR screening and go to the final interview with with only your resume and a video interview you never have to redo
Get paid electronically every month for the hours you work
We will be your reference even if you work for us once

IT Teams: Use ScaleDesk to augment your team

Schedule Demo