Dekleting an unwanted copy of a folder

In my user area I have two folders labeled 'Desktop'. The first contains all the links etc that appear on my desktop and that I use regularly. The second has appeared recently after a panic on my part when my entire documents folder, containing everything I work on, suddenly disappeared, but was recovered using Windows Restore facility. The second 'Desktop' folder in turn contains a folder 'Documents' (!), which in turn contains another 'Desktop' folder identical to the first, described above.

I would like to delete this second series of folders, but if I try, I also lose the contents of the original 'Desktop' folder. How should I go about deleting the second lot without losing the first?

Windows 10.

Reply to
Chris Hogg
Loading thread data ...

Create a temp folder (call it what you like) then move the second folder you refer to into it. If all is well (I'd give it a week or two) you can delete it, if not move it back.

Reply to
Jeff Gaines

Move all the contents of the one you want to keep to a new folder called 'unbork', delete both folders,and rename unbork to Desktop.

Only Windows could allow tow directories of the same name in the same parent directory

Reply to
The Natural Philosopher

In addition to any previous answers - MAKE A BACKUP Copy the folder to an external USB hard drive, pen drive or even to a CD or DVD. Your worst case scenario is then an Operating System reinstall after which you can then copy back all the relevant documents or folders. I keep my documents & data on a separate drive so that if or when I reinstall the OS they are not affected.

Reply to
wasbit

Sometimes the folder you see, is merely a link to the actual folder, so in effect both may be looking at the same folder. You can usually deduce if this is the case by looking at the properties of the desktop folders you have and seeing the path. This has been the case on all windows versions I have seen from at least Windows NT.

If you rename the shortcut to desktop 1 or whatever, it will help you keep track of the folders. Some folders have different permissions of course, and this alone might make deleting a folder a problem unless you either log on to the account that created it or make yourself administrator. Brian

Reply to
Brian Gaff

+1 (and *keep* making regular backups!)
+1 It might be worth checking that the actual files have been copied and not just links (no idea if that is possible as I haven't used Windows since W7).
Reply to
Jeff Layman

It's possible to learn more, about "magical items you created by accident".

*******

formatting link
# This handles softlinks, similar to a symbolic link "ln -s" in Linux

formatting link
"To list junctions beneath a directory, include the –s switch:"

junction -s c:\

# This handles hardlinks, possible made by OS utility "mklink.exe". # You will need a utility to list file system entries, as this utility # does not seem to scan directory trees (like your homedir) looking for # trouble. Hardlinks are used, when sharing one set of clusters with two pointers, # which makes it harder to "lose" valuable information while deleting. Both # pointers must be deleted, before the file is actually "gone completely".

formatting link
findlinks c:\windows\notepad.exe

*******

C:\Users\username> mklink /?

Creates a symbolic link.

MKLINK [[/D] | [/H] | [/J]] Link Target

/D Creates a directory symbolic link. Default is a file symbolic link. /H Creates a hard link instead of a symbolic link. /J Creates a Directory Junction. Link Specifies the new symbolic link name. Target Specifies the path (relative or absolute) that the new link refers to.

*******

To start, you want to acquire a list of file paths for your C: partition, so you have some things to look at. Each entry in the $MFT has a "filenum" and these will be the objects you want to research, to see how you've inadvertently created them.

Analysis with the above tools, you correlate with the text dumped by the general listing of the file system.

This utility was written a long time ago, and think how sweet this would be, with a few simple tweaks to add more info.

You can get a copy of nfi.exe and list the path and filename of each item.

formatting link
nfi.exe c: > nfi_c_out.txt

notepad nfi_c_out.txt # Open in Notepad

Using a putative filename, you could run a findlinks on it. When you see two file pointers in the $MFT entry as shown by "nfi.exe", then the findlinks program will "fill in the details" that an update to nfi.exe would undoubtedly include.

With nfi.exe, you *cannot* see all filenames. This sucks. And it's because a filenum entry, can hold multiple file paths pointing to the same thing. If a person combined (programmatically), the actions of nfi.exe and findlinks.exe , they could augment nfi_c_out.txt and create a more complete listing.

Linux does a slightly better job on NTFS, and lists all the filenames as well as assigning an "inode" number. It turns out, the "inode" number is just the filenum. If two file paths have the same inode number, they are in fact, hardlinked. But Linux has also been put at a disadvantage by the creation of custom reparse points -- Linux does not know how to descend some of those, leading to chaos. One of the custom reparse points is "New style NTFS compression", which is applied on purpose to prevent file system editing from Linux. It is possible to turn compression off completely in Windows, but you may not be able to do this soon enough to prevent mischief by MSFT.

Summary: There are tools, but they are hardly user-centric. More of that "Microsoft does not fuss over its creations". If the source for these was available, we could fix them.

In any case, if you're curious about what kind of file you have before you, there are utilities for the job.

Paul

Reply to
Paul

Thanks for the suggestions, but no matter what I do, whether as a User or an Administrator, whether I copy the contents of the desktop file to a memory stick into a file called Temp, and unplug it, delete the all the desktop files, shut down the computer, restart it (absolutely nothing on the desktop of course), create a desktop file, re-plug in the memory stick and copy over its contents into the new desktop file, remove the stick, reboot the computer, all my desktop stuff reappears OK, but there it is again, two desktop folders, one containing a documents folder, itself containing the original desktop file contents.

Most odd!

I've decided to ignore it and not worry about it any more.

Reply to
Chris Hogg

You keep saying file when I presume you mean folder.

If there are two Desktop folders, then which one did you copy onto Sticky?

Reply to
Tim Streater

Thanks Paul, but that looks a bit too complicated for my computing skills. I worry that when something like this happens, I will inadvertently do something that invokes the BSOD, and will be beyond my skill to recover it! I'll just ignore it and carry on. It doesn't seem to make and difference to how the computer works.

Reply to
Chris Hogg

Yes, sorry, folder

Good question. Can't remember (memory retention of a goldfish these days!). The contents of both folders seem identical. Delete a single file in one of them and it goes from the other, and vice versa.

Which one do you suggest I should copy: Desktop or Desktop\Documents\Desktop ? Both contain the same number of files, but there must be something somewhere that causes the Desktop\Documents\Desktop folder to appear when I try to populate the Desktop folder that I created. I suppose I could try pasting the files one at a time and see which one triggers the formation of the Desktop\Documents\Desktop folder but I suspect even the first will do it, and that it's triggered somewhere else entirely.

Oddly enough, if I use Explorer and look at: Local Disc(C:)> Users> Chris it only shows the Desktop\Documents\Desktop folder, not the simple Desktop folder on its own, rather suggesting (to me, at any rate) that the latter is the copy and the former is the original from which the latter is spontaneously created.

Reply to
Chris Hogg

Sounds like you've soft links or shortcuts, rather than actual folders.

The former would take a "DOS" type command to create, so difficult to do by accident, my guess is that with a mouse-fumble you've dragged the desktop folder into the the documents folder, but then selected the option to create a shortcut rather than to move it!

I think you need to work out what you've actually got before doing anything ... if you select and right-click on each of the "Desktop" folders, then chose properties, you'll get a new dialog

Do you end-up at a "General" tab or a "shortcut" tab?

what do you see for any of the following? "type" "location"

what (if anything) do you see for "target" "target type" "target location"

Reply to
Andy Burns

I don't think it can allow this, but its very complicated to suggest what might have happened. I had a similar issue with dropbox recently though one of the folders had a hidden character in it. Brian

Reply to
Brian Gaff

At least get yourself a copy of "nfi.exe", as it is handy for making a list of files, especially files in areas you can't see.

No Windows utility of that nature, lists all the files. Each listing program has defects that blind it to certain things. But for the purposes of understanding the filenames of the things you do every day, nfi.exe is a useful program for that purpose.

The ZIP file, you have to extract it and find the copy of nfi.exe inside. Which shouldn't be too difficult.

The utility should be run in an Administrator window, so it can access the $MFT (NTFS master file table).

This is a sample of the output. The program does not do anything that requires "regular file system traversal", which is why the file size is not shown, and only a list of sectors where it lives. The sector count though, gives you some idea how big it is, just not a precise number. By not traversing the filesystem, there is less chance of it being "blocked" from listing stuff.

(Administrator terminal window)

cmd.exe # Switch to Command Prompt shell, to make cd work.

cd /d C:\Users\myname\Downloads

nfi.exe c: > output.txt # Output.txt is now in the Downloads folder

notepad output.txt

File 31050 \Users\myname\AppData\Roaming\NVIDIA\ComputeCache\5\7\a0087438c7012c $STANDARD_INFORMATION (resident) $FILE_NAME (resident) $FILE_NAME (resident) $DATA (nonresident) logical sectors 261216-261287 (0x3fc60-0x3fca7)

File 31051 \Users\myname\Downloads\nfi.exe <=== this is the nfi program, listing itself $STANDARD_INFORMATION (resident) $FILE_NAME (resident) $DATA (nonresident) logical sectors 12129008-12129055 (0xb912f0-0xb9131f) <=== the file is not fragmented

File 31052 <=== each file has a "filenum" \Users\myname\Downloads\test.jsonlz4 === there can be "gaps" in the numbers $STANDARD_INFORMATION (resident) $FILE_NAME (resident) $FILE_NAME (resident) $DATA (nonresident) logical sectors 20943552-20943559 (0x13f92c0-0x13f92c7)

Paul

Reply to
Paul

HomeOwnersHub website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.