Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to do this without installing software...

Any ideas?

MSDOS (cmd.exe) on Windows XP

share|improve this question
    
What make and model of DOS? It is/was produced in many forms and versions, with many differences. If you describe what you're trying to achieve it may help elicit a suitable response. –  John Gardeniers Oct 16 '09 at 22:42
    
When you say "DOS" do you mean at the command line in cmd.exe? –  Dennis Williamson Oct 16 '09 at 22:44
    
Also hardlink != symbolic link –  Dennis Williamson Oct 16 '09 at 22:52

4 Answers 4

up vote 6 down vote accepted

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.

share|improve this answer
    
^_^ great. Let me try this. fsutil is available on here. –  qodeninja Oct 16 '09 at 22:52
    
I'm surprised you didn't suggest getting the force-field microscope out and tweak the bits on the disk that way :D –  Jonathan Leffler Oct 16 '09 at 23:12
    
@Jonathan: Nah-- the tunneling electron microscope isn't installed by default, and the poster didn't want to install anything. >smile< Using DEBUG to do things like that isn't too arcane. I've fixed up many a partiton table using DEBUG. –  Evan Anderson Oct 17 '09 at 2:18
    
Cross-linking IS a fault condition and will, or at least should, be detected and repaired by all disk utilities that perform error checking. It will also seriously screw with things like defragmentation. Even, I'm really surprised you even contemplated such a suggestion. –  John Gardeniers Oct 17 '09 at 4:45
1  
@John: If it gets the job done, so be it. I say "technically illegal", "damage the filesystem", and "filesystem error" in my post. I can't be much more blunt than that. If the OP wants to damage his filesystem, he'll do it w/ or w/o my help. It just happens that I made a "trick" diskette several years ago (God... more than several) that I distributed at a "con" that had little tricks like that on it (and a custom boot sector that displayed a little graphical logo), so I'm familiar with the technique. Having said that, I'm sure he was looking for an NTFS hardlink anyway. –  Evan Anderson Oct 17 '09 at 14:21

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.

share|improve this answer
3  
NTFS junction points are a type of reparse point, and aren't the same thing as a hardlink. You're are absolutely technical correct when you say that you can only make hardlinks to files, but the mechanism that junction points work through is different than the mechanism that makes hardlinks work (namely different code in the NTFS driver). –  Evan Anderson Oct 17 '09 at 14:23
    
+1 for Sysinternals' Junction, which worked. –  JYelton May 30 '13 at 23:34

First off, you better be aware that cmd.exe is NOT MS-DOS, and that there are no remaining vestiges of DOS in any version of Windows these days. DOS died following Windows 95/98/ME, XP and it's successors were built on NT, which never had any DOS in it. cmd.exe is a native Windows application that superficially appears as a command-line and is capable of accepting commands similar to old DOS commands, but it is NOT DOS.

Secondly, before you go creating hard links in Windows, you will want to have a read of, and understand, this: http://blogs.msdn.com/oldnewthing/archive/2009/09/28/9900082.aspx

Finally, to do the dirty work itself, use fsutil as Evan describes above, or as is documented here: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/fsutil.mspx?mfr=true

share|improve this answer

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.

share|improve this answer
    
would you mind fixing my -1 down vote so I can pick an answer –  qodeninja May 29 '12 at 16:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.