Why does Windows magically "couple" some files like this?
Why does it do this in the first place?
Because Windows Explorer (specifically) is set up to associate any items with an .htm
or .html
extension with any folder with a _file
or _files
extension, assuming that they have the same basic file name (e.g. example.htm
and example_file
).
Notes
Items are related by file name only. Alterations to the names (e.g. removing
_file
or_files
after the folder name) will stop Explorer from treating them as a pair.I am unaware of any easy way to adjust this association, such as via a Windows Explorer setting or toggle.
Operations run from the command line shouldn't run into this association issue.
Admin
Updated on January 05, 2023Comments
-
Admin over 1 year
I saved a webpage in my browser as HTML. It saved not only a HTML file, but also a directory with various image files and whatnot.
So I deleted the dir, since I only wanted the HTML file.
Windows deleted the HTML file anyway.
I assumed that I had both selected, so I restored them from the trash can and very specifically selected only the HTML file. Delete. Both deleted.
I restored them once again and tried to move the dir to the trash can. The HTML file was deleted again.
Somehow, Windows (10) has "coupled" these internally somehow, refusing to let me move or delete them individually. Extremely annoying.
I ended up deleting them and then restoring only the HTML file from the trash can. It didn't restore the dir in that situation, at least. But that's a ridiculous thing to have to do.
Why does it do this in the first place? I didn't know it could do this at all.
-
Admin almost 2 yearsThe HTML file and directory go hand in hand since the directory contains content for the HTML file - deleting one will delete the other when saved in that format. There should be an option for just a single HTML page, possibly
.mhtml
or something similar - check the drop down menu for the file extension in the Save Dialog. -
Admin almost 2 yearsThis is not a direct answer to your question, but does explain the behaviour described, and how to disable it: superuser.com/questions/103280/…
-
Admin almost 2 yearsDoes this answer your question? Windows deletes HTML files when I delete a folder
-
Admin almost 2 yearsduplicates: How to delete the "_files" folder? How do I unlink a file-folder relationship?, Windows deletes HTML files when I delete a folder, How to prevent Windows file explorer from automatically linking a .html (or .htm) file to a similarly named folder? (Connected Files in File Explorer), How to break Windows Explorer connection between HTML file and its directory?
-
Admin almost 2 yearsYou don't say which browser you used, but Chrome, Firefox, and Edge all have both "html Complete" (which saves the whole page with the folder as you found out) and "html only" (which saves just the html).
-
Admin almost 2 yearsDoes this answer your question? Removing file / folder link after using "Save As..." then "Web Page, complete"
-
Admin almost 2 yearsThat's the one I posted above @DavidZ! Considering the crazy number of upvotes the answer below got, perhaps I should have poured it into an answer...
-
Admin almost 2 years@MiG I think the best thing to do would have been to flag it as a duplicate. That's what I did (more or less), and the system automatically generated a comment linking to the duplicate target - I didn't post that comment manually. Sorry about that!
-
-
Admin almost 2 yearsThere is an option in "Folder Settings" to disable this association. (Or at least used to be; the corresponding registry key would still work in any case.)
-
Admin almost 2 years
I am unaware of any easy way to adjust this association
- check superuser.com/a/103773/519577