Results 1 to 5 of 5

Thread: Strange folder manipulation raises questions

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    675

    Strange folder manipulation raises questions

    If anyone would like to try this, here are the steps.

    1. Create a folder on your desktop called "A", and put a file in it (just for visual identification)
    2. Create a shortcut to that folder
    3. Rename the folder "Ab"
    4. Create a new folder named "A"

    Now, when you open the shortcut it will go to the new "A", and not "Ab"

    5. Rename "A" to "Ac"

    Now, when you open the shortcut it goes to "Ab" (the original "A").

    6. Rename "Ac" back to "A"

    It still goes to "Ab" (the original "A"). Furthermore, if you move "Ab" to another folder, the shortcut can still find it.

    So, it must be using something other than text to identify the folder. Or, does Windows have some history that it keeps so, if it can't find the folder by name, it attempts to find out where it went?

    Basically, I am really hoping there is some unique folder identifier (other than text) that I can tap into. Anybody know?
    VB.Net 2008
    .Net Framework 2.0

    "Must you breathe? 'Cause I need heaven..."

  2. #2
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,922

    Re: Strange folder manipulation raises questions

    I do think it is identifying by the name. There are reasons for this, for example you can't have two folders with the same name in the same directory.

    Now, why your test behaves like this? Here is my analyses that it identifes by name.

    1. When you rename “A” to “AB” and create another “A” it points to the new “A” (the name is the same so it holds my assumption).
    2. When you rename “A” to “AC” it can’t find the folder so it goes by alphabet. “AB” comes before “AC” so it opens the “AB” and updates the name (it holds the assumption).
    3. When you rename “AC” back to “A” it points to “AB” because it updated the name in the step 2 (it holds the assumption).

    Now, if you assume that there is some other identifier then in the 1 step when you rename “A” to “AB” and create another “A” it should point to “AB” but that is not the case.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    675

    Re: Strange folder manipulation raises questions

    It isn't alphabetical.

    If you change "AC" to "AB" and vice versa in the original set of instructions, it will still resolve the name and point to the correct folder.

    It isn't going alphabetical. So, how does it know that A got changed to "AC"? I tried it, and you can also rename the original "A" many times, and it will still find it.
    VB.Net 2008
    .Net Framework 2.0

    "Must you breathe? 'Cause I need heaven..."

  4. #4
    Hyperactive Member ProphetBeal's Avatar
    Join Date
    Aug 2006
    Location
    New York
    Posts
    424

    Re: Strange folder manipulation raises questions

    The way it looks to me, is that when you 1st change the folder windows is using the folder name to keep that connection. When it can't find the name it switches to a memory address for the folder its looking for. If neither can be found then it tells you that the shortcut is missing. After you change the folder name check the properties of the shortcut, you will notice that its target does not change until you have opened the shortcut (which is when windows reconnects the broken link).

    Helpful Links:
    VB 6 - How to get the "Key" Value in a collection
    VB.NET - File Search Utility || VB.NET - How to compare 2 directories || VB.NET - How to trust a network share
    VB.NET - Create Excel Spreadsheet From Array || VB.NET - Example Code & Hints you may not know
    VB.NET - Save JPEG with a certain quality (image compression) || VB.NET - DragDrop Files, Emails, and Email Attachments

    Please post some of the code you need help with (it makes it easier to help you)
    If your problem has been solved then please mark the thread [RESOLVED].
    Don't forget to Rate this post

    "Pinky, you give a whole new meaning to the phrase, 'counter-intelligence'."-The Brain-

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    675

    Re: Strange folder manipulation raises questions

    After you change the folder name check the properties of the shortcut, you will notice that its target does not change until you have opened the shortcut (which is when windows reconnects the broken link).
    Yeah, I noticed that. So, basically, my question is: if that memory address for a folder exists, how can I access it?
    VB.Net 2008
    .Net Framework 2.0

    "Must you breathe? 'Cause I need heaven..."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width