Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

February 13, 2006 12:00 AM

JSI Tip 10153. The Windows XP FSUTIL.EXE HARDLINK CREATE command.

Windows IT Pro
InstantDoc ID #85206
Rating: (0)

You can use the FSUTIL HARDLINK CREATE command to create hard links, an NTFS-based link to a given file which adds a directory entry for the hard link without duplicating the original file.

You can:

Create hard links that use the same file name as the original file but appear in different folders.

Create hard links that use different file names from the original file but appear in the same folder.

Create hard links that use different file names from the original file and appear in different folders.

Because a hard link is a directory entry for a file, an application can modify a file by using any of its hard links. Applications that use any other hard link can detect the changes. However, directory entries for hard links are updated only when a user accesses a file by using the hard link. For example, if a user opens and modifies a file by using its hard link, and the size of the original file changes, the hard link that is used to access the file also shows the new size.

NTFS updates the properties of a hard link only when a user accesses the original file by using the hard link, NOT every time a user makes a change to the original file.

Hard links do not have security descriptors; instead, the security descriptor belongs to the original file to which the hard link points. Thus, if you change the security descriptor of any hard link, you actually change the underlying file's security descriptor. All hard links that point to the file allow the newly specified access. You cannot give a file different security descriptors on a per-hard-link basis.

You cannot create a hard link on one volume that refers to a file on another volume.

To delete a file that has multiple hard links, you must delete the file and all its associated hard links.

Windows XP Help contains:

Fsutil: hardlink

A hard link is a directory entry for a file. Every file can be considered to have at least one hard link. On NTFS volumes, each file can have multiple hard links, and thus a single file can appear in many directories (or even in the same directory with different names). Because all of the links reference the same file, programs can open any of the links and modify the file. A file is deleted from the file system only after all links to it have been deleted. After you create a hard link, programs can use it like any other file name.

Syntax

fsutil hardlink create NewFileName ExistingFileName

Parameters

create
      Establishes an NTFS hard link between an existing file and a new file. An NTFS hard link is similar to a POSIX hard link.

NewFileName
      Specifies the file to which you want to create a hardlink.

ExistingFileName
      Specifies the file from which you want to create a hardlink.

NOTE:

How can I determine a drive size and free space in a Windows XP batch?

How can I display drive information from the Windows XP command-line?

A Windows XP Professional Fsutil Query does NOT work properly on a FAT or FAT32 partition?

How do I create a sparse file of a specific size in Windows XP and greater?

When you add files, via a copy or install, to a Windows 2000 SP4 partition with 512 MB of free space, or less, you receive 'There is not enough space on the disk'?

When you attempt to set the dirty bit on a mount point by using FsUtil.exe in Windows Server 2003, you receive 'Error: Access is denied'?

How can I set the shortname of a file or folder?



Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.