Cirital: Following "Documents and Settings" in Win

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

rad88
Junior Member
Junior Member
Posts: 5
Joined: 2010-01-19, 16:09 UTC

Cirital: Following "Documents and Settings" in Win

Post by *rad88 »

This is critical and can easily lead to a OS permanent damage:
When browsing inside Windows.old directory and following links like "Documents and Settings" Total Commander quietly switches to Windows directory! When trying to clean up Windows.old you are actually deleting files in your current operating system directory.

This happens at least on Windows Server 2008.
MS Explorer however does not show those links in Windows.old directory.

Thanks, Radek
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6507
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

Sorry, but TC is not responsible for the content of your disk.
If there are links it should follow, thats what links are made for.
Windows.old is nothing special for a file manager.
rad88
Junior Member
Junior Member
Posts: 5
Joined: 2010-01-19, 16:09 UTC

Post by *rad88 »

The problem is that TC if following to the wrong location. The link is not pointing to a C:\Windows\Users but C:\Windows.old\Users.
Definitely MS Explorer behaves in different way for the same link (It just cannot follow it since it is not an owner of Documents and Settings, which is normal as Windows.old is the remnant of previous instance of the OS.)

I wouldn't be lenient in this case as the TC users may damage system when trying to remove Windows.old directory.

This is very dangerous problem.

Best regards, Radek
User avatar
karlchen
Power Member
Power Member
Posts: 4603
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, Radek.

I am not quite sure what may be really going on on your Windows system. - In case Total Commander should resolve any unreadable junction to %windir% this would be a serious fault.

First thing: I have not got access to Windows Server 2008 here, but as far as I know it does not behave too differently from Vista. Yet, I cannot really verify my words by looking at Server 2008 right now.

The junction "C:\Documents And Settings" resolves to "C:\Users" here, not to "C:\Windows\Users".

Therefore I wonder a bit why on your Windows Server 2008 "C:\Documents And Settings" should resolve to either folder at all: "C:\Windows.Old\Users" or "C:\Windows\Users". It should resolve to "C:\Users".

Will you have a chance of running a full chkdsk during the next reboot? Maybe the filesystem needs some cleaning up or some fixing?

Kind regards,
Karl
--
Changed the term "hardlink" to read "junction", reason see MVV's explanation below. I admit, spending most of my working hours on Unix systems where there are hardlinks and symbolic links - and I know which is which - I cannot really get used to the Windows terms and how they have to be used. :oops:
Last edited by karlchen on 2010-01-19, 21:47 UTC, edited 1 time in total.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Anyway, junction (maybe directory symbolic link, but not hardlink - hardlinks are just folder items for accessing to file contents) keeps path to target, absolute (usually) or relative (supported only by symlinks, but used rarely), but if you move it (or its parent folder) to any other folder (even on another volume), it will keep pointing to its target folder, its target won't change.

If you want to see targets and real path for files inside reparse points, you may use my plugin NTLinks. Also, you may search all folder reparse points using usual TC search: just open Plugins tab and add rule "tc.file type = reparse point".

Note that when you remove reparse point within TC, it just removes reparse points but not erases contents of its target folder. But Windows Explorer sometimes may remove extra files (even in Windows 7 I know case when it does it - just do a junction cut/paste between different volumes).

Windows.old folder contains all contents of previous Windows installation moved to this folder in order to clean root of system drive. So, it contains only symlinks and junctions used by Windows, but theese don't point to Windows folder, only to C:\Users, C:\ProgramData and to their subfolders. Here full list of compatibility reparse points (i.e. Documents and Settings and similar) excluding some translated names like My Documents on user's language:

Code: Select all

C:\Documents and Settings\	C:\Users	Junction
C:\ProgramData\Application Data\	C:\ProgramData	Junction
C:\ProgramData\Templates\	C:\ProgramData\Microsoft\Windows\Templates	Junction
C:\Users\All Users\	C:\ProgramData	SymlinkD
C:\Users\All Users\Application Data\	C:\ProgramData	Junction
C:\Users\All Users\Templates\	C:\ProgramData\Microsoft\Windows\Templates	Junction
C:\Users\Default\AppData\Local\Application Data\	C:\Users\Default\AppData\Local	Junction
C:\Users\Default\AppData\Local\History\	C:\Users\Default\AppData\Local\Microsoft\Windows\History	Junction
C:\Users\Default\AppData\Local\Temporary Internet Files\	C:\Users\Default\AppData\Local\Microsoft\Windows\Temporary Internet Files	Junction
C:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\	C:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs	Junction
C:\Users\Default\Application Data\	C:\Users\Default\AppData\Roaming	Junction
C:\Users\Default\Cookies\	C:\Users\Default\AppData\Roaming\Microsoft\Windows\Cookies	Junction
C:\Users\Default\Documents\My Music\	C:\Users\Default\Music	Junction
C:\Users\Default\Documents\My Pictures\	C:\Users\Default\Pictures	Junction
C:\Users\Default\Documents\My Videos\	C:\Users\Default\Videos	Junction
C:\Users\Default\Local Settings\	C:\Users\Default\AppData\Local	Junction
C:\Users\Default\My Documents\	C:\Users\Default\Documents	Junction
C:\Users\Default\NetHood\	C:\Users\Default\AppData\Roaming\Microsoft\Windows\Network Shortcuts	Junction
C:\Users\Default\PrintHood\	C:\Users\Default\AppData\Roaming\Microsoft\Windows\Printer Shortcuts	Junction
C:\Users\Default\Recent\	C:\Users\Default\AppData\Roaming\Microsoft\Windows\Recent	Junction
C:\Users\Default\SendTo\	C:\Users\Default\AppData\Roaming\Microsoft\Windows\SendTo	Junction
C:\Users\Default\Start Menu\	C:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu	Junction
C:\Users\Default\Templates\	C:\Users\Default\AppData\Roaming\Microsoft\Windows\Templates	Junction
C:\Users\Default User\	C:\Users\Default	Junction
C:\Users\<user>\AppData\Local\Application Data\	C:\Users\<user>\AppData\Local	Junction
C:\Users\<user>\AppData\Local\History\	C:\Users\<user>\AppData\Local\Microsoft\Windows\History	Junction
C:\Users\<user>\AppData\Local\Microsoft\Windows\Themes\Windows 7\DesktopBackground\	E:\Pictures\DesktopBackground	Junction
C:\Users\<user>\AppData\Local\Temporary Internet Files\	C:\Users\<user>\AppData\Local\Microsoft\Windows\Temporary Internet Files	Junction
C:\Users\<user>\Application Data\	C:\Users\<user>\AppData\Roaming	Junction
C:\Users\<user>\Cookies\	C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Cookies	Junction
C:\Users\<user>\Local Settings\	C:\Users\<user>\AppData\Local	Junction
C:\Users\<user>\NetHood\	C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Network Shortcuts	Junction
C:\Users\<user>\PrintHood\	C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Printer Shortcuts	Junction
C:\Users\<user>\Recent\	C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Recent	Junction
C:\Users\<user>\SendTo\	C:\Users\<user>\AppData\Roaming\Microsoft\Windows\SendTo	Junction
C:\Users\<user>\Templates\	C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Templates	Junction
(I have Windows 7 installed and think that yours will be something similar)
rad88
Junior Member
Junior Member
Posts: 5
Joined: 2010-01-19, 16:09 UTC

Post by *rad88 »

To clear things a little:

"C:\Windows.old\Documents and Settings" is resolved by TC accidentally
not to C:\Windows.old\Users (this is the backup of previous C:\Users) but to the current "C:\Users".

Thanks, Radek
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

rad88 wrote:"C:\Windows.old\Documents and Settings" is resolved by TC accidentally
not to C:\Windows.old\Users (this is the backup of previous C:\Users) but to the current "C:\Users".
NOT accidentally! Junction contains absolute path that points to C:\Users, so tell me why and how TC may resolve it to some other place?

If you afraid to access your system files through theese junctions you may find them all (I wrote how) and remove - only junctions will be removed, and your files will be protected.

BTW, try to rename Windows.old folder to something else - will Explorer show theese junctions then?
User avatar
karlchen
Power Member
Power Member
Posts: 4603
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, Radek.

Now you have managed to confuse me completely about the nature of your problem:

In your initial message you wrote
When browsing inside Windows.old directory and following links like "Documents and Settings" Total Commander quietly switches to Windows directory!
I.e. you stated T.C. would resolve "Documents and Settings" to "C:\Windows".

Now, however, you write
"C:\Windows.old\Documents and Settings" is resolved by TC [...] to the current "C:\Users".
So T.C. does not take you to "C:\Windows" (which would be incorrect), but to "C:\Users" (which is correct).

So how in the world is T.C. then going to delete any objects inside "C:\Windows" by accident?
It takes you to "C:\Users" (correct). If you start deleting stuff here, then you remove objects from "C:\Users", not from "C:\windows".

My conclusion:

These contradictory statements strongly suggest that the problem is not inside Total Commander, but rather that it is a fundamental misunderstanding on your side. :P

Kind regards,
Karl
rad88
Junior Member
Junior Member
Posts: 5
Joined: 2010-01-19, 16:09 UTC

Post by *rad88 »

I just reported a TC serious bug. What you do with it it's your business.

Either you treat your clients with respect or your treat them abusive trying to pick on insignificant mistakes I indeed made on the very beginning (either deleting C:\Users or C:\Windows content will destroy your system significantly) is your solely choice.

Some people are just like C compilers, they can't see the major problem because of missing ';' at the end of the first line.
That's really sad. :(

----

To MVV: When I tried to change the name Windows.old to something else, MS Explorer still can't follow these junctions (links). Actually there is only one junction in Windows.old folder: "Documents and Settings". If this would point to C:\Users as TC thinks it is, then Explorer should in the same way follow to C:\Users. Either of two (TC and Exporer) can't handle them properly - but IMHO, it is safer just to show "Access denied" than to follow them.

> NOT accidentally! Junction contains absolute path that points to C:\Users, so tell me why and how TC may resolve it to some other place?

So why is Explorer not resolving it to C:\Users?

Radek
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

rad88 wrote:To MVV: When I tried to change the name Windows.old to something else, MS Explorer still can't follow these junctions (links). Actually there is only one junction in Windows.old folder: "Documents and Settings". If this would point to C:\Users as TC thinks it is, then Explorer should in the same way follow to C:\Users. Either of two (TC and Exporer) can't handle them properly - but IMHO, it is safer just to show "Access denied" than to follow them.

> NOT accidentally! Junction contains absolute path that points to C:\Users, so tell me why and how TC may resolve it to some other place?

So why is Explorer not resolving it to C:\Users?
I don't know why, and this is quite interesting, but I have no any guesses. I just know that if junction exists and user follows it, application should follow it and not say that it is impossible. And bug here - is that someone can't follow junction. Although, I don't see access rights for your junction, but TC uses system access rights, so system decides sufficient rights or not.

As you say, Explorer still can't follow junction if you rename Windows.old to something else. Does it mean that I can't have junction like C:\MyLinks\Documents and Settings pointing to C:\Users? I don't see any logic here.

And, there are more than one junction in Windows.old folder - don't forget about junctions in Users folder. I will repeat, just delete them and don't worry. :wink:
rad88
Junior Member
Junior Member
Posts: 5
Joined: 2010-01-19, 16:09 UTC

Post by *rad88 »

That's really strange to me, too. I have checked both "Document and Settings" junctions (that in C:\ and in C:\Windows.old) as for Security settings and they all looks the same (Owner, Effective Rights etc.) but I don't have any tools that would tell me what lies behind these two junctions and how they are differentiated by MS Explorer.
What may be of some interest to you is (I can't post links yet): It's at support microsoft com slash kb slash 930527

Just guessing but it may be related to the fact that both junctions are owned by SYSTEM but different SYSTEM users(?) and Explorer can somehow check if the SYSTEM is really current SYSTEM account?

Cheers, Radek
User avatar
karlchen
Power Member
Power Member
Posts: 4603
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, Radek.

You are not my customer. We both are T.C. users and forum users, no more, no less. If you first tell us that following the link "Documents and Settings" Total Commander takes you to "C:\Windows" and next time you tell us that following the link "Documents and Settings" Total Commander takes you to "C:\Users", then this is contradictory.

In case Total Commander incorrectly jumps to "C:\windows", this would indicate an error situation.
In case Total Commander correctly jumps to "C:\Users", no error is committed, neither by Windows, nor by Total Commander.

So it is your contradictory statements that make me wonder whether any software bug has been reported at all. I fail to see what may be abusive about it.
Some people are just like C compilers, they can't see the major problem
I would like to understand what the problem is, this is why contradictory statements need to be cleared up.
So why is Explorer not resolving it to C:\Users?
Maybe you launched Total Commander in elevated mode whereas Explorer was not launched in elevated mode? In this case it is well imaginable that T.C. can resolve the junction target of "Documents and Settings" whereas Explorer cannot.

Kind regards,
Karl
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

karlchen wrote:Maybe you launched Total Commander in elevated mode whereas Explorer was not launched in elevated mode? In this case it is well imaginable that T.C. can resolve the junction target of "Documents and Settings" whereas Explorer cannot.
Elevation is not required to resolve target of Documents and Settings. All users can open Documents and Settings folder.
rad88 wrote:I don't have any tools that would tell me what lies behind these two junctions
You may check this using TC's plugins NTLinks or NL_Info (outdated a bit, but it supports junctions too).
rad88 wrote:What may be of some interest to you is (I can't post links yet): It's at support microsoft com slash kb slash 930527
0
Well, article doesn't make clear why Explorer can't enter that junction since users don't require extra rights to enter it - if Windows let TC to resolve junction, Explorer also have such right. The question is "why it doesn't do it?".
rad88 wrote:Just guessing but it may be related to the fact that both junctions are owned by SYSTEM but different SYSTEM users(?) and Explorer can somehow check if the SYSTEM is really current SYSTEM account?
I think SYSTEM account is the same on all systems (has same GUID) because if Windows can't find GUID, it shows GUID instead of user name.
User avatar
karlchen
Power Member
Power Member
Posts: 4603
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, MVV.
Elevation is not required to resolve target of Documents and Settings. All users can open Documents and Settings folder.
True. I had suspected that for some reason Windows might have modified the ACLs for the objects inside C:\Windows.old. - Maybe this assumption was wrong.

I still wonder why using Windows Explorer it should be impossible to resolve the target to which the junction C:\Windows.old\Documents and Settings points, whereas Total Commander seems to be able to resolve it.

If I double-click on a junction which cannot be resolved on Vista, Total Commander v7.50a just gives a "pling" sound and goes nowhere. So it does not look as if T.C. takes "wild guesses" in case a junction cannot be resolved.

Anyway, hopefully Radek will find out where the junction C:\Windows.old\Documents and Settings points to.

The Knowledge Base Article How to use the Disk Cleanup feature to delete the Windows.old folder after you install Windows Vista does indeed not seem to hold any new piece of information which would explain why on Radek's machine Explorer should not be able to follow the link C:\Windows.old\Documents and Settings at all.

Hopefully, we will get to the bottom of the problem in the end so that it will be clear whether Total Commander did malfunction or whether a Windows component malfunctioned or whether something else was the cause.

Kind regards,
Karl
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

MVV wrote:..Well, article doesn't make clear why Explorer can't enter that junction since users don't require extra rights to enter it - if Windows let TC to resolve junction, Explorer also have such right. The question is "why it doesn't do it?".
Maybe because these junctions are not meant to use for manual navigation:
svrops.com:: Junction Points in Vista wrote:Access Denied

You might have noticed when clicking on a folder in Windows Explorer, with a shortcut icon on it (a Junction Point), you get an Access Denied message from Vista.
This is to be expected.
As mentioned above, the Read permission for Junction Points is set to EveryoneDeny.
You are not supposed to access these folders, and there really is no reason to access these folders.
Again, these Junction Points are just pointers to the new folder structure used in Vista.
Personally, I have banned these old campatibility junctions since more than a year using TC's ignore list feature.
Reading this bug report and the discussion, I come to the conclusion that an option (default on; for experts) "ignore/hide such junctions" would be the best solution.

See also:
Incorrect remote NTFS link behaviour

Kind regards
Holger
Post Reply