Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Unbreakable Shortcuts


  • Please log in to reply
10 replies to this topic

#1 Andrew

Andrew

    Bleepin' Night Watchman


  • Moderator
  • 8,258 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:02:52 PM

Posted 29 December 2007 - 04:24 PM

I'm sure you've had this happen before: you double click on a shortcut and Windows balks at you because the target has moved.

Will the annoyances never end?

Caution: This tip involves manipulation of the file system. While not inherently dangerous, care should be taken when dealing with the file system.

This little trick utilizes a little known feature of the NTFS file system. Users of Unix-like systems will be more familiar with it, but us Windows folk are just cluing into it.

Whenever you see a file in Windows Explorer, you're not actually looking at the file. You're looking at a little stub that points to where the file data is physically stored on the hard drive. That is called a hard link.

It's possible for a particular file to have many hard links pointing at it, that is to say: more than one hard link can point to the same spot on your hard drive.

Trouble is, there is no way to make new hard links through the Windows GUI. One must use the command line (though I'm working on a little tool that will allow creation through a friendlier GUI. Check back to see if I finished it.)

Here's what you do:

1. Open up the command shell (Start->Run type cmd then enter)
2. At the command line, type fsutil hardlink create NewFilename ExistingFilename (where NewFilename is the name of the new hard link and ExistingFilename is the name of the file that you want to point to)
Like this:

fsutil hardlink create MyNewLink.txt MyExistingLink.txt

A few caveats:

1. Hard links cannot span volumes. That means that they can only point to files on the same drive or partition.
2. If you create a hardlink to a file and then delete the original file, the file still exists. In order to delete a file you must delete all hardlinks that point to it.

Additional Reading:
http://www.microsoft.com/resources/documen...k.mspx?mfr=true
http://en.wikipedia.org/wiki/Hard_link

BC AdBot (Login to Remove)

 


#2 Damaru

Damaru

  • Members
  • 68 posts
  • OFFLINE
  •  
  • Local time:01:52 PM

Posted 02 January 2008 - 02:47 AM

Hi Andrew,

I read through your post several times and looked at the pages at both of the links you provided, but I'm still a little confused...

Would the 3 different instances of the `My Documents' folder occuring in the WE tree-list be examples of 3 different hard links to the same data?

Edited by Damaru, 02 January 2008 - 03:37 AM.


#3 Andrew

Andrew

    Bleepin' Night Watchman

  • Topic Starter

  • Moderator
  • 8,258 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:02:52 PM

Posted 02 January 2008 - 03:10 PM

Now I'm a little confused. I'm not sure what you mean by "3 different instances of the `My Documents' folder occuring in the WE tree-list". Could you elaborate?

#4 Damaru

Damaru

  • Members
  • 68 posts
  • OFFLINE
  •  
  • Local time:01:52 PM

Posted 02 January 2008 - 10:38 PM

"Could you elaborate?"

My understanding is that the Windows XP folder structure contains 3 different instances of the `My Documents' folder (i.e., the same data is presented to the user in three different locations in the Windows Explorer folder-tree (at least two of which do not represent its real location in memory and thus constitute a level of abstraction between the user and his or her hard drive)).

My question was whether these 3 instances of the same folder are in fact `hard links' of the kind you described above.

Edited by Damaru, 03 January 2008 - 01:08 AM.


#5 Andrew

Andrew

    Bleepin' Night Watchman

  • Topic Starter

  • Moderator
  • 8,258 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:02:52 PM

Posted 03 January 2008 - 03:36 AM

Are you talking about how the My Documents folder can be accessed from a shortcut on the desktop, under "My Computer", as well as its actual location of C:\Documents and Settings\username\My Documents? If that's what your question, then no, that's a different (but similarly interesting) construct.

#6 Damaru

Damaru

  • Members
  • 68 posts
  • OFFLINE
  •  
  • Local time:01:52 PM

Posted 03 January 2008 - 07:23 AM

Yes, that is exactly what I was referring to. That is helpful to know, Andrew, thanks. :thumbsup:

My understanding (which is only tentative) is that the three instances of the `My Documents' folder are actually mirrors of each other (the real location being C:\Documents and Settings\username\My Documents as you rightly pointed out), and that, because of this, any changes made to the contents of one will automatically be reflected in the contents of the others.

My reason for asking about this construct and whether it had any relation to the `hard links' you described in your first post is because I've been looking for a way to reproduce the automatic synchronization that occurs across these three folders on my own. If there was a way for me to safely emulate this behavior, I was thinking it might enable me to access items stored in even the most deeply-buried folders on my computer in two clicks from the desktop.

By way of example, if I were to create a folder inside the Quicklaunch folder that mirrored the contents of a high-level folder like `My Computer' and then place that folder's Quicklaunch icon in the comma of the Quicklaunch bar (i.e. the part that is revealed by clicking the double-arrow or guillemot), all of that folder's sub-folders (as well as all of its sub-sub-folders and sub-sub-sub-folders, etc.) would become accessible via hover-activated flyout menus on the desktop.

With a halfway-decent knowledge of the Windows XP folder tree (and a cascading menu display setting that is optimized for one's personal mousing ability), this would provide most users with a way of getting at most any location on their computers as quickly (or more quickly) than any other commonly-available means.

Then again, there is probably already an app out there somewhere that provides precisely this functionality.

If anybody knows, please share!

Edited by Damaru, 03 January 2008 - 09:08 AM.


#7 Damaru

Damaru

  • Members
  • 68 posts
  • OFFLINE
  •  
  • Local time:01:52 PM

Posted 03 January 2008 - 09:04 AM

As it turns out, I am an idiot! LOL :thumbsup:

After submitting that last post I went back and tweaked my toolbars a little bit and discovered that there is already an optimal solution to the `2-click universal folder access' problem built into the Windows XP GUI.

All you need to do is create a new toolbar on your desktop, detach it from your taskbar, drag it up to the top of your screen (where it should snap neatly into place), create a new `Desktop toolbar', drag it up so that it integrates into the first toolbar you created on the left-hand side, then expand the first toolbar to the left until no items are left on the visible part of the Desktop toolbar... When you're done, you should have a new combo-toolbar at the top of your screen with a drop-down menu on the left-hand side that will allow you to access any folder on your computer in two clicks from the desktop.

Edited by Damaru, 03 January 2008 - 09:14 AM.


#8 Andrew

Andrew

    Bleepin' Night Watchman

  • Topic Starter

  • Moderator
  • 8,258 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:02:52 PM

Posted 03 January 2008 - 03:03 PM

Those toolbars are very useful indeed! Did you know that you can drag pretty much any folder's icon to the edge of the screen to create a toolbar to that folder? It even works for special icons like "My Computer" and "My Network Places".

#9 Dialer

Dialer

  • Members
  • 642 posts
  • OFFLINE
  •  
  • Gender:Female
  • Location:The Great State of Disarray
  • Local time:02:52 PM

Posted 03 January 2008 - 03:22 PM

Thanks Damaru and Andrew! That's a great tip about dragging folders around to turn them into toolbars. I have made toolbars for the taskbar on occasion, but this is even cooler.

#10 Andrew

Andrew

    Bleepin' Night Watchman

  • Topic Starter

  • Moderator
  • 8,258 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:02:52 PM

Posted 10 January 2008 - 04:56 AM

Here's the little app I promised: http://www.boredomsoft.com/Files/ntfshardlinker.html

#11 a55ess

a55ess

  • Members
  • 1 posts
  • OFFLINE
  •  
  • Local time:05:52 AM

Posted 25 February 2008 - 01:16 PM

:thumbsup: thanx guys... i'm a newbie..




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users