2007-04-09

The Windows Help System

I hate windows. I'm terrible at it. I dislike the UI, the desktop system, the lack of privilege separation (perhaps except in vista, I haven't tried it), the various APIs, the shell, the filesystem (why can't you delete a file that's in use if you're the administrator?) and various other systemic dislikes. My hatred of the OS is nothing personal. It's largely a matter of taste, therefore: if you like windows, you are not wrong, you are different. I don't.

Windows is a fact of life if you need foxpro for work. It's not reasonable to run foxpro in WINE, so I just live with my windows desktop. With cygwin and X loaded, I find the desktop pretty usable since I mainly just use it for the bash shell and xterm windows (and, of course, the occasional foxpro process). Mostly it just sits in the idle state looking very useful.

I'm a linux nerd.

I was having this problem where the initial login to my desktop was taking a terrible long time. It would sit on "Loading your personal settings..." for nearly a minute. I rarely reboot if I can help it so it took a while to get around to it, but today I began to track it down. Before you begin to wonder, msconfig and the registry \run\ locations were my first stops — but I had tried them before, and it just wasn't a startup program, so my heart wasn't in it.

When I have a problem like this in linux and I'm not sure where else to start, I usually run an strace on the offending program to see what it's getting stuck on. Normally debugging lasts about a minute after that. You can indeed run strace on the login processes (gdm, X, and various other things) if you know basically how the startup goes on your machine.

So I ask my windows friends, "Know of a way to track down what it is on my desktop/start-menu that takes like a minute to come up? It just says 'loading personal settings' and sits there for like a minute."

IdentityM says, "That means your profile is huge. There is a profile cleaner/shrinker somewhere on google."

"What is my profile? like my desktop?"

"Its your profile (ntuser.dat)" he says.

"My ntuser.dat is only 4 megs, is that huge?"

"No... but that's still what it is...your profile."

"I think it's more likely to be an icon I have that's on a network share or something... I wish there were some way to make windows verbosely describe what it is that 'loading settings' is doing. What I really want is to strace the gdm." I got ridiculed for saying icon (the blue e?!?), but I did literally mean icon. One of shortcuts to a particular foxpro program sometimes resets itself to use an icon from a shared directory. Random settings changes are part of life in windows, so I just ignore that problem as best I can.

IdentityP suggested I, "Rename your profile, create a new one."

Yeah, sure. I hate windows. I do not want to waste an hour with usernames and reboots and then have to re-arrange my desktop, background images, document history, startmenu icons, startup scripts, quicklaunch bar, and all that other stuff I dislike using. That sounded like a whole evening right there, so I choose to ignore it — but filed it away as a worst case solution that I may need later.

Thankfully, IdentityM argued, "I would log in as a diff user (admin) and rename the ntuser.dat of the busted one, and try logging in as that user."

IdentityP made sure to bite back, "I dont ever attempt to fix profiles cuz it turns out worse than when you started."

"Also, check out sysinternals.com, there is lots of stuff there I think you will find interesting and/or helpful. But, it's your hosed profile." IdentityM was clearly quite certain about this.

"Yeah, you said that before but without indicating why you think so ... I need to see it to believe it."

"Experience."

I've never worked with him, but I didn't really have any reason to doubt him. Generally speaking, windows needs to be reinstalled about once per year and I haven't reinstalled windows on this machine since I got it from dell. So I went through the trouble of a clean reboot to a fresh admin user and moved my ntuser.dat file to an oops.dat name. Unlike the advice of IdentityP, the advice of IdentityM can be undone.

The next login did not go well. I gave it 30 minutes to boot (while working on something else) but it never finished. I did a hard reset, booted to my fresh admin user and put the ntuser.dat file back. I decided to ignore IdentityM and IdentityP completely and started looking (again) for the actual source of the problem.

Still thinking it had something to do with my start menu or my quick launch bar, I started CDing around in my user dirs from bash. I located some links to the K: drive (network share) and the T: drive under \NetHood\. After thinking about it briefly, I removed all my network shares completely and violla: My login was instantaneous again. So fast, in fact, I didn't even have time read the "Loading your personal settings" phrase to transcribe it to this article. I hadn't really expected that to fix it, but trying random easy to fix solutions is apparently the name of the game in windows, so I did it correctly (I guess).

Now, I appreciate their efforts, I really do. It takes a kind soul to want to help their friends fix their busted OS (particularly if they aren't any good at it); however, in this case I almost wish they hadn't have helped at all. They distracted me from the actual problem for almost an hour and nearly talked me into ruining my desktop for no particular reason.

I help quite a few people with their computers over the phone. One even switched to ubuntu, although I installed it for him and made him use the livecd semi-exclusively for an entire week before I would even go that far. One is my mother, who is becoming very good at diagnostics and computer security (compared to most parents anyway). One thing I always tell these users is to never (ever) try any advice that sounds like a lot of work without calling me first. It's better to get a quick phone call than a painful day at their house helping them fix their desktop — or mine in this case.

So I elected to mention it, "Removing all the shares made the login instantaneously snappy. Clearly removing and re-adding my user would not have worked. I would have had the same problem again in a day or so... so I'm glad I figured it out by hand."

My goal there was to try to indicate that, diagnostically speaking, they had no real reason to believe anything was wrong with my profile. In fact, I indicated that I thought it was somehow related to my network shares. They lead me on a terrible wild goose chase based on "experience."

The next response from IdentityM was a little indignant, "Well, you're welcome for us trying to help you, when you asked for it."

But I didn't really ask for a wild goose chase about profile corruption IdentityM. I asked for help figuring out what "Loading personal settings" was getting stuck on, particularly something like strace and probably relating to network shares. It wasn't actually help they were offering. They were trying to look like Genius Windows Masters rather than trying to actually help.

I did thank him, but I also said, "You have to learn to listen to the patient. Their self-diagnosis is usually wrong, but it contains hints of the actual problem." I left the channel, but I was still irritated enough to record the conversation on a blog in essay form (or something like it I think). There are some helpful lessons we can take away from this exchange:
  1. It's ok to not know something. A lack of an answer on my IM client would have given me more time to use google and try some more trial and error. It's probably better to just ignore the question than jump to conclusions. Another option is to suggest, "It could be ProblemDescription." Even if your absolutely certain, with a total lack of any evidence, it's better not to pretend your diagnosis is definitely correct.
  2. Do not accept advice based on "experience" unless the giver can also help demonstrate the conclusion with a diagnostic tool (or at least point you to the correct diagnostic tool). In this case, renaming my user and making a new one would have wasted hours and not actually helped with anything!
  3. In windows, you must guess. There is no way to determine what is actually happening and it's better to just reinstall the OS (or the user, or whatever) when it malfunctions. I find #3 to be completely impossible to believe, but that's what people keep telling me. At least we know to start with things that are easy to fix first and upgrade to hard stuff later.
  4. Don't let windows "automatically reconnect" network shares at login on a laptop... Half of them won't be there when you change locations and your login will then take minutes (literally) to complete.
Like most things in windows, network shares can be scripted. Here is an example showing my final solution to the network shares vs login problem:
net use t: \\hostname\tdrive password /user:nonlogindomain\nonloginusername
net use s: \\hostname\sdrive password /user:nonlogindomain\nonloginusername
net use /P:No
Violla!! I have my network shares where I need them as batch files on my start menu and I enjoy instantaneous logins to my desktop.

random links: LaTeX, fxp.one, breeding perls, dbhome