Suggestion: Warn for delete with junctions

English support forum

Moderators: white, Hacker, petermad, Stefan2

isidro
Junior Member
Junior Member
Posts: 96
Joined: 2006-03-21, 04:39 UTC
Location: argentina

Suggestion: Warn for delete with junctions

Post by *isidro »

Ruined a windows installation once when trying to delete the Windows.Old folder because it had wrong junctions to outside active windows folders (ie: "C:\Windows.Old\Archivos de Programa" pointed to "C:\Program Files" instead of the inner " "C:\Windows.Old\Program Files"). Total Commander started deleting files outside the intended target.
An extra warning should be showed whenever deleting (and maybe when moving) files that are placed outside selected target...
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Suggestion: Warn for delete with junctions

Post by *ghisler(Author) »

Total Commander does not follow junctions when deleting, it just deletes the junctions themselves.
Author of Total Commander
https://www.ghisler.com
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Suggestion: Warn for delete with junctions

Post by *Horst.Epp »

isidro wrote: 2019-01-17, 14:05 UTC Ruined a windows installation once when trying to delete the Windows.Old folder because it had wrong junctions to outside active windows folders (ie: "C:\Windows.Old\Archivos de Programa" pointed to "C:\Program Files" instead of the inner " "C:\Windows.Old\Program Files"). Total Commander started deleting files outside the intended target.
An extra warning should be showed whenever deleting (and maybe when moving) files that are placed outside selected target...
The Windows Cleanmgr.exe is responsible for deleting Windows.old.
Using this tool is the normal way to delete old Windows installations.
But I did it once in the past with TC and it didn't destroy anything outside of it.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: Suggestion: Warn for delete with junctions

Post by *MVV »

I've tried to delete a folder with a junction in it when the folder requires admin rights, but TC 9.21a for some reason was unable to delete it via 'As Administrator' button... When I've deleted the junction manually via the same 'As Administrator' button, TC could remove the folder.
Last edited by MVV on 2019-01-22, 06:52 UTC, edited 1 time in total.
isidro
Junior Member
Junior Member
Posts: 96
Joined: 2006-03-21, 04:39 UTC
Location: argentina

Re: Suggestion: Warn for delete with junctions

Post by *isidro »

So I don't know how or what happened then. Maybe it was coincidence. Thanks.
isidro
Junior Member
Junior Member
Posts: 96
Joined: 2006-03-21, 04:39 UTC
Location: argentina

Re: Suggestion: Warn for delete with junctions

Post by *isidro »

Been able to reproduce HUGE issue, when entering on a HD (to fix) "G:\Users\All Users" it actually takes you to local HD: "C:\ProgramData", but windows title states you are on "g:\Users\All Users\" so anything one deletes there it's being deleted on C: drive instead of G:
I think in that way I might destroyed a working OS.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Suggestion: Warn for delete with junctions

Post by *ghisler(Author) »

This can happen when the hard link (junction / Reparse point) only allows to be opened / followed, but the target name cannot be read. Then TC cannot know where it points.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: Suggestion: Warn for delete with junctions

Post by *MVV »

ghisler(Author) wrote: 2019-01-24, 10:41 UTC This can happen when the hard link (junction / Reparse point) only allows to be opened / followed, but the target name cannot be read. Then TC cannot know where it points.
Why does TC remove anything behind a reparse point if it is being able to detect that it is a reparse point? It just should never delete anything behind any reparse point, but just delete the reparse point itself.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Suggestion: Warn for delete with junctions

Post by *ghisler(Author) »

Why does TC remove anything behind a reparse point if it is being able to detect that it is a reparse point?
It doesn't, except if it doesn't detect that it is a reparse point.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: Suggestion: Warn for delete with junctions

Post by *MVV »

Ok, but I think that such items should be non-listable, correct? If a folder can be listed in dir, its reparse point flag may be get via WIN32_FIND_DATA structure.
zupermario
Junior Member
Junior Member
Posts: 26
Joined: 2011-04-01, 21:11 UTC

Re: Suggestion: Warn for delete with junctions

Post by *zupermario »

I too, deleted my files in my drive C deleting folders from external USB (a disk with windows from another computer, with standard win7 junction point like "\Users\All users" pointing to "c:\ProgramData", etc.) :-(
Total Commander should not follow junction points, instead it often follows them :-( :-(
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Suggestion: Warn for delete with junctions

Post by *ghisler(Author) »

When deleting, TC only deletes the junction itself, not the target, except when Windows reports it as a directory and not as a junction.
Author of Total Commander
https://www.ghisler.com
zupermario
Junior Member
Junior Member
Posts: 26
Joined: 2011-04-01, 21:11 UTC

Re: Suggestion: Warn for delete with junctions

Post by *zupermario »

ghisler(Author) wrote: 2020-02-16, 11:47 UTC When deleting, TC only deletes the junction itself, not the target, except when Windows reports it as a directory and not as a junction.
So maybe the way windows is interrogated, or the way it responds, is not reliable, because more than once at me TC has deleted the data, not the junction :?
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Suggestion: Warn for delete with junctions

Post by *Usher »

2zupermario
What Windows version do you use?
Andrzej P. Wozniak
Polish subforum moderator
zupermario
Junior Member
Junior Member
Posts: 26
Joined: 2011-04-01, 21:11 UTC

Re: Suggestion: Warn for delete with junctions

Post by *zupermario »

Usher wrote: 2020-02-22, 18:52 UTC 2zupermario
What Windows version do you use?
It happened to me with both windows 7 and windows 10.
Post Reply