How do you create a symbolic (hardlink) in CMD.exe

Are you talking about MS-DOS or Windows XP?

Since it's likely that you're just talking about doing this from a command-prompt on Windows XP I'll answer for that case first... >smile<

On an NTFS volume under Windows XP you can use the "fsutil" tool to create a hard link:

fsutil hardlink create <destination filename> <source filename>

Both source and destination must be on the same NTFS volume.


MS-DOS only supports the FAT filesystem (in various flavors). FAT doesn't "officially" support hard links. You could create the effect of a hard link by having two directory entries that refer to the same FAT chain. This would be detected as an "error" by CHKDSK and repaired, however.

If you didn't mind manipulating directory structures by hand using DEBUG you could get this done w/o installing any software. It wouldn't be pretty, but it would work.

As I said, though, it's technically illegal to have two directory entries point to the same FAT chain. Running a disk defragmenter on such a volume would probably damage the filesystem. CHKDSK would definitely see such a "jury-rigged hard link" as a filesystem error.


fsutil hardlink works only for files. If you want to make link to directory, you could use junction from sysinternals package.

Be aware: if you try to delete link, contents of destination directory would be also deleted. To remove link, you should use juncion -d switch.

You could recognize links in Total commander: they have different icon than directories. In windows explorer these links looks the same as any directory.


linkd.exe is found in the windows 2003 resource kit. I just tested this and it works better than NTFS junctions. If you can download linkd.exe and get it to work on XP you would be all set.