366 points · by raffraffraff · 4y ago · 244 comments
They logged into Windows 7 (I know, upgrade...) and it looked like their files were missing. In a panic, they opened Explorer and searched for their files. They turned up in the search. They just didn't show up in the usual "My Documents", "My Pictures", "My Videos" paths.
They decided to move the files "to the correct place". And then they shut the computer down.
The next time they started it, the same thing happened. This is where I got called in, because this time, the files didn't show up in a search. I told them to turn the computer off immediately and drop it with me.
Can you guess what happened? Well, check this out:
- Windows couldn't use their user profile because it was corrupted
- So it created a temporary profile in "C:\Users\TEMP". (This wasn't obvious to the user because Explorer hides the 'detail' of the file path and simply shows the username)
- Unwittingly, when they moved the precious files to the "correct" place, they were putting them into a temporary profile.
- On shutdown, Windows promptly deleted the temporary profile, so "C:\Users\TEMP" got wiped along with all of the files.
I was frankly astonished that Windows would drop them into a temporary user profile without dire warnings about its transience. Anyway, now I have to try to recover not only the files, but the directory structures. I'm not even sure it's possible... :(
I really really dislike Windows when it hides paths, for example, "My Pictures". Where the heck is that?
This lunacy infects Windows applications, like Quicken and Thunderbird, which spew themselves and their data into gawd knows where hidden directories. Why can't they simply do the obvious? Create a \Quicken directory in the root, and have a \Quicken\program and \Quicken\userdata ? But noooo.
Networked machines. (Aside from the obvious security problems on a multi-user installation.) The "gawd knows where hidden directories" (of which there are two, %APPDATA% and %LOCALAPPDATA%, plus, on a recent Windows version, a number of compatibility links and some sort of integrity level thing) are segregated into the part which should have an authoritative copy on the file server ("roaming") and the part that can or has to stay on the workstation ("local").
And you aren't the only user on pretty much every OS. There are many many many built in "users" for different internal operations.
Android has been copying Apple in that it now also has automagic folders and file managers. I also remember Google doing some idiotic A/B tests some moons ago of hiding the actual page result URL, it was one of the reasons (on top of search quality) that I stopped using it.
On Android you now have to go through multiple settings to enable explicit paths as if was somehow an 'advanced' feature to show an explicit file path.
I assume it is mostly driven by UX somehow it is now an agreed truth that file manager abstractions are too complex for the average user to grasp therefore must be vigourously hidden at all cost.
Or to people in different age brackets: for a few years now, people have finished uni while doing all their work on phones and tables without a desktop OS involved. No files, no desktop, no actual applications. We should stop copying desktop mentalities into modern workflows.
Or the other way around: nobody has desks or paper folders in file cabinets anymore, nobody needs to physically handle files and organise them, nor do their have boxes for physical mail that comes "in" and goes "out". We should stop copying legacy office concepts into software.
Windows has an existing convention for this, like Linux's XDG. Imagine if you looked at your Linux filesystem root and saw /boot, /dev, /usr, /tmp, and /Quicken.
You'd probably see a /Quicken/ as well as a file /Quicken-uninstall as a broken symlink to nowhere.
I helped my wife reorganize many hundreds of images. Finding out where they really were located and where they would actually end up was a tremendous chore, and locating them again has continued to be difficult.
Even doing a backup is stressful. Where are the files really located?
macOS is the same.
Also, don't use 14 years old EOL systems.
Beyond that, getting a full path is trivial (realpath) and figuring out which block device backs it is also quite straightforward (findmnt).
Contrast to windows where your "Documents" folder might be getting backed up via one drive or roaming profile, or it might just be local disk on that machine.
In my experience for a corporate windows environment its best to map a H: drive to a network home drive share and get users to always save in there - if its not mapped it means you are probably on misconfigured host.
The second best is a fully manual directory structure with no “surface” added. But this is not nearly as good for the average user.
By far the worst one is what you get when you (correctly) like Microsoft realize you are in the second category but you’d like to be in the first. The end result is an annoying middle ground that has plagued windows for a long time now. They probably (incorrectly) assumed they could get to the iOS situation eventually.
Separating the application and its binaries isn’t a bad idea though. I don’t want to back up applications, just their data, for example. And I want to be able to have different permissions for the app binaries and elsewhere. So programs\Quicken and data\Quicken would be better than the other way around. And this isn’t far from what windows does. If I create an app I put the user data in %appdata%\myprogram. The folder is annoyingly hard to find though but that’s more an explorer UX issue than a problem with how the files are stored.
• Videos I need to watch for class.
• PDFs I need to read for class.
• Word documents I am writing for class.
• Photos, videos, and audio recordings I will use to write papers for class.
The "iOS model" would have me segment all of this data by file type. The PDF from New York State on K-12 educational standards would be next to my 2021 tax returns. My paper on single-sex schools would be next to the technical documentation for a web app I'm developing. This would be terrible.
Files need to be organized by purpose, not file type. I know what my files are for. My computer does not.
This is also a major reason why I hate my iPhone.
All that said, I do agree with the general premise that files should be organized in reasonable places by default and users should be able to override that should they see the need.
I’m not saying the final solution to data organization is just “all Images in one directory”. The solution is one where you don’t worry about directories and still easily find and group the data you need.
Windows had grand plans for this that were scrapped. Understandably, but also sadly.
And yes, of course no one should be stopped from having one area where they have a word document, six images and a text file. OF COURSE. But whether that's a directory or not isn't what's interesting. The interesting part is that I can group them together logically, find and use them easily etc.
https://www.cgsecurity.org/wiki/TestDisk
edit: oh, I just read that you mentioned TestDisk. Yes, it can recover the directory structure, at least it did in my case. After using it you will likely see that some files have been duplicated with a suffix added, like document.doc and document.doc.xyz (can't recall the exact suffix) in the same directory. In that case you need to check which file has been fully recovered, and rename it if needed.
You'll do much better with purpose-build Windows undelete utilities. I've had good luck with freeundelete:
Photorec is about files only.
They are both vey good at what they are supposed to do, but in your case Testdisk is not suited and Photorec represents a last attempt as recovered files are carved, basically you will lose not only directory structures, but also filenames and metadata.
A good GUI tool (not of the "one click" type, it needs some learning to use it) is DMDE:
(My story: just last week I fixed a temporary profile issue for an acquaintance and all that had happened was that Windows messed up the connection with her online Microsoft account. After signing out and in again, it worked fine. I was surprised at first because I wasn't aware that such a thing as temporary profiles existed. It became clear that she was working on a wrong profile once I opened a shell and the path before the prompt said "c:\users\temp".)
There are definitely warnings that any work/data stored in the temporary profile would be lost, so maybe they did not take these seriously enough.
The only thing that I actually find absolutely unforgivable is that the temporary profile is named after her normal account. Creating temporary accounts with ample warnings, yeah, not great. Pretending to be the profile of the user...? Nope
Microsoft seems to have tried to get rid of outmoded notions such as directories, without ever articulating what new model they favoured. So you get these privileged spaces (I have no better word) like "Documents". They've tried to make Explorer as invisible as possible.
But they never finished the job! So you end up with a mess of "AppData" (apparently a normal directory) and "Application Data" (not accessible). I presume the first is an alias for the second; but the second should be invisible if it's not accessible (there are other directories like this).
This started with Win7. Then they stopped abruptly, but never reverted these aborted changes. It's as if there's nobody in charge. My guess is that forcing Microsoft accounts, "instrumentation", and failed attempts to hegemonize mobile were prioritized over fixing what they'd broken.
NT4 was a reasonable OS, with a rotten commandline. Nothing they've shipped since has come close.
And all of these partially duplicate functionality. Want to change the password of a different user account? You can’t do it from the user account panel - you can only do it from the other user account panel.
But it also made the 250 character path limit much easier to reach. When the NT unification happened with 2000/XP the shorter AppData was used with "Application Data" remaining as a junction point to the roaming profile for compatibility.
It is invisible unless you decided to enable "Show hidden and system files".
Should Explorer have three modes, "no hidden", "show hidden and system but only some", "show all files"?
Who would complain if they would make it like that?
What the fuck?!
So it all but forces you to link your identity to something Microsoft owns... just to refuse your identity back and throwing you into some unrecognizable woods if Microsoft fails to validate it.
I guess failing to log you on your own computer because MS is down would enrage people. So it's better to gaslight them until they give up.
If Microsoft has full access to your hard drive and can make changes to your system and files any time they want they own a lot more than your user profile. It's their system. They are the admin, and you are a peasant and the extent of your access to your(?) data and Microsoft's system can be limited or revoked at any time.
The real-world number of linux admins who inspect all packages before applying them is basically zero. Most Linux/BSD systems likely have unattended upgrades enabled by default.
But yes, if you get an script with the set of actions that make local accounts possible, you can replicate them.
And there's this nagging alert that keeps popping up:
"Microsoft account problem."
"We need to fix your microsoft account. (Most likely your password changed). Select here to fix it in shared experiences settings."
Which I assume most novice users would obey.
https://answers.microsoft.com/en-us/windows/forum/all/seeing...
How do you diagnose a corrupt profile? What causes corruption? Is there some diagnostic I can run that will detect and repair corruption before it's too late?
Not on Windows 7
Don't turn it on, don't turn it off, don't login/logout. Ideally keep the wifi router turned on, but disconnect it from upstream internet.
It's very hard to get people to follow this of course but it's critical, especially now FDE is becoming more common. In the extreme case you can leave it on until you can cause an exploit remotely or are ready to immerse it in liquid nitrogen and extract the FDE keys from RAM. There are tools (wiebetech.com) for moving plugged in computers onto battery power if you can't work in situ or can't risk a grid outage.
We've spent decades telling users that the miracle fix for all their technology problems is turning your device off and on again. That's going to a long time to undo.
Q1 - Would you be very very upset if all the data on your computer was lost Y/N Q2 - Do you have backups of this data? (The answer is invariably No.) Q3 - Is your computer behaving strangely? Do you have a spidey sense of doom which caused you to contact me? Y/N
At which point it should be clear that further unqualified FA&FO is a bad idea.
Not affiliated in any way, just a sporadic user.
Like, look
https://learn.microsoft.com/en-us/windows/deployment/usmt/us...
Those are the path variables
Ez
But logically? How hard is c:\users\username\whatever?
Are you all so so so into Linux that you are just utterly flabbergasted by the simplicity of Windows?
All operating systems hide hidden paths also. You can enable showing hidden paths. You should just know where programdata is where appdata is... The difference between local and roaming and locallow... I mean cmon nerds! Get with it!
On Linux or Mac. Tell me. Where is Documents? Where is Pictures? Where is applications? Is Documents in ~/Home/Documents? Where is that if I'm not the current user? Why is Applications on Mac in my home folder different than the Applications in Macintosh HD/Applications? Why can I Macintosh HD/Volumes/Macintosh HD/Volumes/? Windows is somehow the insane one? Windows makes sense!
Instead of all agreeing that you're confused by something that you should be an expert in at this point if you are working in the computer space at all... Maybe you should take some time out to actually brush up on some skills that could be useful that you could help family members with. Because bitching around the sewing circle isn't going to inspire confidence and it's not going to help your case in any sort of way that you would think if you actually want to change or improve the situation of file system hierarchy.
Remember, we are the nerds that know everything! Act like it! If Windows is so beneath you; then master it completely! Don't just ignore it because you think you're so much better than it. I see so many comments and threads on hacker News constantly where people are just like "I haven't touched windows in 15 years and then I had to touch it last week and oh my God this and that and this and that." And to me that is just the sign of someone who gave up.
Not hard at all. But Windows really, really goes out of its way to fight me using that.
> You can enable showing hidden paths. You should just know where programdata is where appdata is...
Yeah, because the onboarding tutorial for new accounts explains all that. Not.
Some of us do know this stuff, and we can sort of understand why Microsoft made the decisions they did (they make sense, or at least less nonsense, in large corporate environments of Word users).
But they are still a nasty product of the "reach for abstraction" impulse of programmers with not enough experience to know that they're working outside their zone of mastery.
But you really have to try and put in some effort here.
Without taking action to have it your way, you'll be left to the default approach which Microsoft has molded for users who may never grasp filing systems at all, which is simultaneously backward-compatible with DOS. And then third-party software which sometimes tries to better cope by having their own layer of obscurity which can help your workflow but the filing can end up even more ugly.
But the filing cabinet never was an office machine anyway, and as far as automatic, I would much rather have a real intelligent secretary file & retrieve my folders than I would a machine.
And without a secretary I figure I'm going to have to put in some effort my dang self, and get the most out of the electronic filing at my fingertips.
The C: volume containing DOS or Windows was subject to the most frequent defects or corruption and could be considered the most risky place to put any of your valuable data if you could help it.
But regular PCs for office or home were supplied with only one partition on their HDD so there was no separate volume that could be dedicated exclusively for storage. The highest-reliablity upgrade was having a second hard drive dedicated for storage, but naturally you had to work from a blank slate and label all the folders yourself just like a secretary would do. Further you need to be very vigilant and direct any valuable data from all Windows or third-party apps to your dedicated folders every time. However nobody actually needed this drive space at the beginning since that's when there's always plenty of room on C:.
But it was worth it.
Be your own secretary.
Yes the C: drive was still a PITA to restore but it was good to maintain readiness to Format C: at any time without losing any valuable data at all.
Then restoring only the system (Windows, installed apps, and settings) quickly from backup, or alternatively reinstalling them in the previously optimized repeatable full recovery procedure. Always install programs to C: right along with Windows. To a newer, faster, or bigger HDD whenever you felt like it. The C: drive was like the office machine substitute, where you need to be able to change some of the things on your desktop or even get a whole new desk from time to time, but you wouldn't want to handle your company files and their filing system as disposably as you would a broken office machine.
And the second HDD volume was the filing cabinet substitute, which could physically be moved or copied and placed into a different office without affecting the desk or desktop that generated the data.
Now this was before the Documents And Settings folder appeared. Which pushed the mainstream in the opposite direction, placing your valuable data by default into folders automatically labeled and tucked away largely within deeply nested trees within Windows' increasing number of self-created folders, and completely downplaying any underlying need to know the filing system at all. Instead of all being in one filing cabinet, your data became a "part" of Windows and it became acceptable for your files to be less accessible to your fingertips alone. Not without Windows and each App in question being there in perfect working order. And with temporary files from the internet growing right there in the same folders, rendering your relatively small number of useful business files more like a needle in a haystack as time goes by.
Is this risk really worth it just to have the simplified option of multiple users in offices where everyone needs their own Personal Computer to begin with?
Anyway they basically call it the Users folder now and you've got a symbolic link from Documents And Settings, so the woods got deeper that time too.
I hate having to knock down more trees just to get stuff done.
Even when paperwork has been my only product so much of the time.
With effective multi-partitioning it became within reach to have separate volumes for Windows vs. Your Data, when you only have a single HDD. You do have to take action from there.
Which is a step in the right direction but with fast external USB drives it's one of the best ways to physically separate your personal filing cabinet from your office/machines again. Plus externally store your well-tested working backups of Windows' less-sizable full C: volume itself as .WIM files, to hammer a reformatted C: often with, which can be quicker than defragmenting with about the same outcome if you do it right.
Losing a laptop doesn't have to be so bad if there are no credentials or company data on board to begin with, but as always don't leave your stuffed filing cabinet in your competitor's reception area. Especially if it fits in between the couch cushions.
However, this also shows why having a "backup" is always a good idea. So when/if you do recover what you can recover, you might also consider setting them up with some form of automatic backup such that should this (or a disk failure, which is always a possibility) occur in the future, recovery can be "restore from latest backup" instead of the task you are now facing.
However, an equally good idea when faced with a sudden and utterly unexpected situation, is to not immediately try to solve the problem without understanding what actually happened. The chances of the "fix" doing more harm than good is high.
That said, consumer software should definitely not assume that the user understands how the internals work. In this case, rather than a popup being shows, it would have been more appropriate to give the user a full-screen walkthrough, similar to the first-launch experience, explaining what has happene, what Windows has done, that the documents and pictures are most likely safe, and finally include warnings about the active profile, and associated documents and pictures, being deleted when logging out.
I would be much better to show an error at login saying there is a problem with the account and a question like "Would you like to log in as a guest user?"
That's basically what I was suggesting.
What is so baffling to me is that it's not being fixed. It would be understandable if it only affected power users or if it was a launch-day issue getting patched in the first week. But it isn't.
See the recent experiences with Notepad or Voice Recorder for examples.
Does it? I recall using Windows 7 and being dropped into ~TEMP sometimes, but I was warned with a notification.
https://answers.microsoft.com/en-us/windows/forum/all/my-pro...
A notification in the status bar, along with their other 10+ notifications about Skype, printers, antivirus etc. They didn't see it, or if they did see it, didn't understand the implications. The horrible thing is that they didn't want to bother me with it, and tried to solve the issue themselves :(
I also doubt the typical user will know that profile is shorthand for user profile and know what that is.
End result: because of corruption of some data the user likely is only remotely interested in, all data they were interested in got deleted.
https://www.windowsphoneinfo.com/attachments/97fdf7d3-6fca-4...
The trick here is how do we solve this other than further user education? When the user profile folder is unusable for some reason you either have to do this or just refuse login. Neither are good answers, but this one is better as long as you understand what the system's doing.
If one doesn't know what the system's doing and isn't interested in trying to understand it I don't see a way to avoid this issue.
Hell, even just changing the terrible wording on the notification (and putting it somewhere much less ignorable) would be a step forward. E.g. "Your files have been temporarily moved to X. Any files you place in My Documents, My Pictures (etc) will be deleted when you log off or turn off your computer.").
Or the move opration immediately prompted for admin authorisation, and they just clicked through that? (not suggesting that these prompts are in any way useful for the average user)
As this whole discussion shows, no, this one is worse since it can easily lead to data loss. A third option, however, would be to do this but not erase the profile on logout.
My lessons learned from it.
windows profiles are far too complicated, it was hard to find low level information on how they work or how to diagnose and fix a bad profile.
make sure you have and know another login. preferably the admin one.
Edit: this might be what you meant by the admin one (rather than a)
In this case the deleted files would have to recovered. I recently use Easus Data Recovery Wizard and was able to restore a lot of files for a client who's photo storage drive crashed. It would be best to pull the drive and do the recovery on another computer. I think the free tool allows up to 2GBs of data recovery but in this case the client had 100's of GBs so he paid for a 30 day license for $65.
I hate how Explorer tries to be clever with the Documents etc folders but it just makes it obtuse. Like if I open Documents from the side bar and press Up Directory I end up in My Computer not my home folder.
After https://news.ycombinator.com/item?id=18189139 , I don't think I want the OS to know where else I'm storing my files.
So this is the source of the problem. How does it happen?
You can use autopsy which is open source to carve for files. Or you might be able to use binwalk.
Of course the bin eventually recycled his files which led to him finally reaching out for help.
Windows -
1) Automatically forced a temporary profile creation instead of asking to do so.
2) Forced automatic temp profile alert was too small and quiet, so the end-user simply ignored it.
User-
3) No backups.
Also, I'm not entirely certain that Windows automatically deletes temporary profiles.
But before you do that, make sure the issue isn't the hard drive itself. If the hard drive is damaged, you may still be able to recover data, but it'll need to be done by someone who knows what they are doing. If the drive is spinning irregularly, or clicking, or not recognized by another system you might have issues.
Source - I used to work in a digital forensics lab.
https://d3nevzfk7ii3be.cloudfront.net/igi/n4Fo16YKi45Y5JxL.f...
Source: https://www.ifixit.com/Guide/MacBook+Air+11-Inch+Mid+2011+So...
Tell them to flip it on once a week if not more often.
Press the backup button.
Turn it off when done.
Now they have the ultimate offline backup for a full restore regardless of corruption, virus, hacked, etc.
And take an image before booting the disk.
Not having a backup is a platform agnostic way to lose files, and works pretty reliably given sufficient time.
Windows 8 came out in 2008.
Typo; you meant to say 2012.
As long as they are just "deleted" and not overwritten, file recovery on Windows used to be easy.
I remember undeleting was possible in the old FAT days.
Shame on Hacker News for doing this juvenile "Mico$oft WINDOWS BAD" crap. It's boring and stupid.
and move / effectively delete them all?
why does a temporary profile have such privileges
Gray on beige, really?
Do we have to wait for YOUR eyesight to worsen before you realize some basic usability?
There is warnings... Now the Win7 one is just the notification baloon and easy to miss but the 10 one is pretty "in your face"
Windows 7: https://imgur.com/a/ao5AtO6
Windows 10: https://imgur.com/a/Hl9XnZV
Windows likes to tell stuff of no urgency all the time and people will close those click. click. click.
IMHO when the computer is used in extraordinary situation the UI should be making it very clear. Probably all kind of customisation should be removed so the user feel like in wrong place and has high alertness. When moving files into folders that will be deleted the user should be warned with a short and scary message(macOS warns you that the files will be deleted from the cloud if you move files out of iCloud synced folders like Desktop and Documents).
The point is, the user should be made aware that this is not business as usual and proceed with extreme caution. A popup with cryptic title and long paragraph won't do it.
No old data is deleted. In OPs case the user moved the data over to the temp one and then it gets deleted on relog.
For a home user the fix is hopefully to just reboot
For a domain users I have to do this when it happens: https://www.tenforums.com/tutorials/48012-fix-youve-been-sig...
Or maybe a temp profiles directory structure shouldn't be visually similar or identical to a full a profile.
Lots of low hanging fruit here.
https://support.microsoft.com/en-us/windows/send-feedback-to...
Is this a normal thing in Windows?
I'm sure there was some warning. But you know, users don't read messages...
windows didn't drop them into a temporary user profile; the user did that.
windows assumes that you know what you're doing when you move files around. everyone loses their minds when it doesn't make this assumption.
Windows tells you when it logs you into a temporary user profile. it doesn't do that silently.