• #### Tales from the interview: Can you rotate this two-dimensional array?

My colleague jeffdav told me about one job interview with a graduating college senior that didn't go well because the candidate simply gave up.

He offered a simple programming task: Write a function that takes a 4×4 two-dimensional array and rotates it clockwise by 90 degrees. For example, the entry in the upper left corner of the array goes to the upper right corner.

The interview candidate simply gave up without even writing so much as a function prototype. "I can't do it."

— Okay, well, let's take it a step at a time. Maybe take a specific example and see what we can learn from it.

"It's some sort of matrix multiplication."

— All right, well how would you start working that out?

"I don't know. I can't do it."

That's really not a good way to demonstrate your problem-solving skills: By responding to a problem with a simple "I can't do it." All of us are faced with things we can't do. The important thing is that we are willing to learn what we need in order to be able to do them.

I wonder if this particular person thought that attitude would fly at a real job. If your boss gives you a difficult job, would you just say, "I can't do it"? Heck, how do you even graduate from college with that attitude? Your professor gives you an assignment, and you just say, "I can't do it"?

(The punch line for people who actually know matrix algebra: Matrix multiplication doesn't solve the problem anyway.)

Bonus commentary: I reprint JeffDav's comment which he posted below, since it is after all his story.

This was a question reserved for intern candidates and fresh out of college hires. I was usually the first one on the loop and used this as a warm-up question. Once they got it, we'd move on to something more interesting. This one guy just refused to believe it was even possible.

Also, I would phrase it as "rotate an N x N matrix where N >= 1, and you are given N along with the matrix A." This makes it super easy. If you allow an N x M matrix (i.e. non-square) the question gets much harder.

I don't ask this question as often anymore. I get bored with asking the same questions over and over. Furthermore, I think after about the 100th time you ask a question you have lost perspective on it. Once you can write the answer on the whiteboard by heart without even thinking, you get annoyed by anyone who takes more than a few seconds thinking about it. It may not be a conscious annoyance but it's there if you think about it, and I think it gives you a bit of a negative bias at times. At least it does for me. It's good to find new questions so you have to solve them yourself and you have that feeling of approaching the problem for the first time fresh in your memory.

• #### Even without a nitpicker's corner, I have to worry about nitpickers

Even without a nitpicker's corner, I have to worry about nitpickers. I just have to do it in a more subtle way.

Here are some examples of changes I've made to upcoming entries in order to forestall nitpicking:

Original text Revised text Reason
... entries in our list... ... entries in our table... The entries are kept in an array, but writing "list" may cause some people to nitpick that an array is not a list.
... this function returns X... ... this function can be asked to return X... The function returns different things based on what the caller requests, but the only case we're interested in right now is the case of X.
... X affects only Y. ... X typically affects only Y. Again, I have to add the qualifier to protect against the case where a program intentionally broadens the scope of X.
... X isn't a problem because... ... X isn't usually a problem because... There can be cases where X is a problem because the program explicitly created the problem for itself, so I have to put in a qualifier. Indeed, later in the article I give an example of how a program can cause this problem, so I'd better leave myself some wiggle room at the expense of rhetorical power.
... a holiday.... ... a holiday in the United States... Otherwise somebody would make some smart-alec remark like "It's not a holiday where I live." [Typo fixed: 10am]
... the kernel .... ... the exception dispatch code... To avoid confusion between "the kernel" and "kernel mode".
... 64KB ... ... about 64KB... Because the limit is actually 65280 bytes.

What's scary is that I've noticed that I begun pre-emptively nitpicking my own entries while I'm writing them. In the balance between writing something that reads more naturally and something that is more resiliant to nitpicking, I've unfortunately started preferring the latter.

Observant readers may have noticed that I've slowly introduced a section called "Pre-emptive snarky comment" wherein I try to anticipate drive-by "Hey wouldn't it be hilarious if I ridiculed Microsoft on a Microsoft employee's blog?" comments. It seems to be largely successful, although sometimes people will post the identical snarky comment that I pre-empted. These are probably the people who talk just to enjoy the sound of their own voice.

An extension of this is the "Now that you brought up something that sucks, I'm going to tell you that it sucks" phenomenon. This is pretty much guaranteed whenever I bring up anything that is related to UAC and security, since it appears that everybody agrees that UAC sucks, so any blog entry that talks about elevation invariably leads to comments about how UAC sucks. There are also popular tangents, such as any article that mentions installing software turning into a "post your complaints about setup here" thread.

Some people are more indiscriminate and merely bash Vista whenever they get a chance, such as using a story about the psychology of how people fail to process information that they see to rant about how it's hard to copy text out of the event viewer.

(That article about how people fail to process information that they see was indeed an unmitigated disaster. Everybody got into arguing over how the message should have been presented so the user would be more likely to see it, but that completely misses the point. The user positively confirmed, "I see the yellow warning." The problem wasn't that the user didn't see the message; the response confirmed that the user saw the message just fine. What the user didn't do was process the information. It's my fault for choosing a bad title. Instead of "People can't see things that are right in front of them," I should have titled it "People see things but don't pay attention to them," opting for precision even though it meant I couldn't use the idiomatic phrase can't see what's right in front of you. What made it worse is that I fell for the trap. I responded to the details instead of saying, "Whether your suggestion would have helped the user see the message or not is totally irrelevant to the point of the article.")

I also hadn't predicted that my discussion of how reasonable people can disagree about how a setting should be exposed would turn into a discussion of how to shut down your computer, turning a footnote into the primary topic of discussion. But that's a fairly common occurrence: People focus on a side detail (which I added for color) and ignore the point of the story. Sometimes I think I'd be better off if I didn't give examples. That way nobody could be distracted by them.

• #### Why does Windows hide keyboard accelerators and focus rectangles by default?

The release of Windows 2000 introduced a new setting: "Hide underlined letters for keyboard navigation until I press the Alt key," which defaults on for most Western languages. What's the story behind this setting?

I still have the rationale from the user interface designer who introduced this feature. Here's a redacted copy:

To support our goal of greater simplicity, we plan to suppress keyboard navigation indicators by default. Don't be frightened...

The idea is to reduce visual noise in Windows, namely focus indicators and access key underlines in menus and windows. Aesthetically, these things are distracting and intimidating. Functionally, they're only useful when you're navigating by keyboard. They don't add significant value when you're just using the mouse. In fact, they're often redundant.

Why now? Every good thing must start somewhere. Windows will look cleaner and simpler.

What's so bad about the way things are? Access key underlines are largely underutilized and are often redundant with Ctrl+ shortcuts within the same menu. There's no indication that you have to type the Alt key to use these shortcuts. Plus, it's just odd to see characters underlined within text all over your display. Focus rectangles lack graphic integrity, and they're often redundant with the highlight on selected items or the default button.

Of course, the keyboard indicators will come back when there is any demonstration of keyboard navigation by the user. The indicators will appear and disappear appropriately. Finally, if you don't like the behavior at all, you can disable it from the Display control panel.

For what it's worth, this is one of the things I [the interface designer] came to Microsoft to fix.

An additional point not mentioned in the original rationale is that with the rise of the web browser as the primary use of a computer, users have increasingly been conditioned to treat underlined text as "Click me" rather than "Use me in conjunction with the Alt key to activate this item".

The thing about seeing randomly-underlined letters all over the screen is a point many technically-inclined people miss. To a typical user, all these indicators scream "Entering a propeller-head zone!" and "You are not smart enough to use this computer."

What does frustrate me about this setting, though, is not its design but its implementation. Using the arrow keys to navigate a pop-up menu doesn't appear to count as a "demonstration of keyboard navigation by the user", which is particularly frustrating since you can't use the Alt key to make that demonstration, for the Alt key dismisses the menu! To see what the keyboard accelerators are for a pop-up menu, you have to find a way to cause the menu to pop up based on a keyboard action (usually hitting Shift+F10 when focus is on the appropriate element). This is often harder than it sounds.

• #### A modest proposal: Getting people to stop buying SUVs

I developed this modest proposal many years ago, but it looks like rising gasoline prices have done the job. But in case they don't, here's my plan.

SUVs are classified as "trucks" for the purpose of C.A.F.E. regulations, and those regulations are more lenient on gasoline efficiency for trucks. As a result, the auto industry happily built SUVs safe in the knowledge that high SUV sales wouldn't lower their overall fleet mileage and therefore not risk violating the CAFE regulations.

On the other hand, most other highway regulations do not consider SUVs to be trucks. As a result, SUVs sit in this sweet spot where they get to pretend they're a truck when it's advantageous to be a truck (avoiding CAFE regulations) and pretend that they're a car when it's advantageous to be a car (highway regulations).

My modest proposal was to get rid of this loophole. If you're going to let SUVs be classified as trucks for the purpose of determining whether they are subject to CAFE regulations, then classify them as trucks for the purpose of highway regulations. If you're driving an SUV on a highway that has different speed limits for cars as opposed to trucks, then you have to adhere to the truck speed limit. Because you're a truck. If you're driving an SUV on a highway which bans trucks from the leftmost lane, then you are banned from the leftmost lane. Because you're a truck.

People who are driving a truck because they actually need it for truck-like activities (hauling lumber, pulling a boat, delivering baked goods, whatever) won't be seriously inconvenienced, since they're not going to be doing any of those car-like things anyway.

If you really want to take this principle to its conclusion, you would even have to stop at the weigh stations to ensure that you're not over weight, and to check your log book (you keep a log book, right?) to ensure that you're not violating the laws regarding the maximum permitted number of hours behind the wheel of a truck. Because you're a truck.

Of course, the loophole could be closed the other way, too: Alter CAFE to classify SUVs as cars. Either way works for me. Just make the CAFE regulations and highway regulations agree on who is a car and who is a truck.

As I noted, it looks like economic forces have solved the problem on their own, but in case SUVs suffer a new surge in popularity, you've got my proposal in your back pocket, ready to spring into action.

Yes, this modest proposal is out of order, but it seemed more timely than the planned topic (solving the problem of identity theft), which I will still get to next time, if there is a next time.

• #### Non-resolution of the dead home desktop problem

Last time, I told of attempting to upgrade my home computer and failing. I ultimately gave up and returned the parts to the store, telling them that I thought the IDE controller on the motherboard was dead. They refunded my money after a false step where they refunded me more than I paid for the components in the first place! (I bought the motherboard and CPU as a bundle, but the person who rang up the return treated them as two separate items and ended up refunding me the full price instead of the bundled price. It's one thing to return a defective product and get your money back. But to turn a profit doing so is downright wrong.)

Thus bereft of computer equipment, I drove down to the local Fry's and bought a bottom-of-the-line computer which would merely serve as a shell for all my working equipment. I would be using the motherboard, CPU, memory, and case from the computer, but I didn't care for the other stuff since I would be performing an "instant upgrade" with the old computer's DVD drive and hard drives. It cost about $60 more than the parts I bought from the failed upgrade attempt, but the saved grief was well worth it. Skipping ahead in the story: After I got the machine up and running, I plugged one of my old hard drives into the machine and... the BIOS recognized it, and the volume mounted just fine. On the other hand, I can't access the files on the drive yet. I don't have a domain at home (I'm not that big of a geek), so my SID on the new computer is different from my SID on the old computer. My new account can't access files created by the old account. I would have to do some SID history magic to get access to the files protected by my old SID, but I'm just going to take the lazy way out and do a recursive "replace ACLs" on all the files on the old hard drives. (This requires multiple passes, though. First I have to take ownership, then I can change the ACLs after I become the owner.) Now about that new computer. It comes with Windows XP Media Center Edition, even though the video card doesn't have a DVI connector. I was kind of baffled by this. If you're going to run Media Center Edition, doesn't that mean you're highly likely to hook it up to some awesome flat-panel display for watching your videos? I don't quite understand why this bottom-of-the-line computer with an analog-only video card bothered to install Media Center Edition. Who are they fooling? Okay, so I'm going to have to upgrade the video card, too. That increases the cost delta over the parts to around$160. Still worth it though.

One of the odd features of the new computer is that it has a 9-in-1 multi card reader built into the front panel. This is a cute feature, but it is also frustrating since it gobbles up four drive letters.

But that's okay. I already described how you can fix this when I talked about the infinitely recursive directory tree. I created a directory called C:\CARDS and inside it created directories C:\CARDS\CF, C:\CARDS\SD, and so on. I then used the Disk Management snap-in to de-assign drive letters from each of those card readers and instead mounted each card reader into the corresponding folder I had created. Now I can access the contents of the CF reader by going to C:\CARDS\CF.

One thing that really frustrates me about off-the-shelf computers is all the shovelware that comes with them. I fire up the computer and my notification area is filled with useless icons I don't want to see again, with more stupid programs jammed themselves into the Run key. No, I don't need an AOL monitor running. No, I don't need QuickTime pre-loaded. No, I don't need a program to monitor my card readers and do some evil icon chicanery.

The evil icon chicanery is particularly gruesome because every time I log on, I get a dialog box that looks like this:

 × fAIL

Good job there, stupid evil icon program. I bet you assume the user is an administrator.

The computer also came with a recovery partition. I hate those too.

Today's status is that I'm not out of the woods yet. I have a working computer, I can mount my old hard drives (though it'll take work to get access to the files), I still have to upgrade the optical drive to the rewritable DVD drive that I had in the old computer. I still have to get rid of all the shovelware that came with the system. I still have to reinstall the drivers for my rewritable DVD drive and printer. (I'm sure I have that CD around here somewhere.) And I still have to get a new video card that supports digital output so I can use an LCD panel.

Some improvements:

• USB 2.0 ports. (My old computer had only 1.0.)
• The fans shut off in standby mode. (My old computer left the fans running, which negated much of the benefit of standby mode.)
• "Shut down and restart" actually works. (For some reason, my old computer was incapable of restarting.)
• The new computer is a lot quieter.
• #### Everybody thinks about garbage collection the wrong way

Welcome to CLR Week 2010. This year, CLR Week is going to be more philosophical than usual.

When you ask somebody what garbage collection is, the answer you get is probably going to be something along the lines of "Garbage collection is when the operating environment automatically reclaims memory that is no longer being used by the program. It does this by tracing memory starting from roots to identify which objects are accessible."

This description confuses the mechanism with the goal. It's like saying the job of a firefighter is "driving a red truck and spraying water." That's a description of what a firefighter does, but it misses the point of the job (namely, putting out fires and, more generally, fire safety).

Garbage collection is simulating a computer with an infinite amount of memory. The rest is mechanism. And naturally, the mechanism is "reclaiming memory that the program wouldn't notice went missing." It's one giant application of the as-if rule.¹

Now, with this view of the true definition of garbage collection, one result immediately follows:

If the amount of RAM available to the runtime is greater than the amount of memory required by a program, then a memory manager which employs the null garbage collector (which never collects anything) is a valid memory manager.

This is true because the memory manager can just allocate more RAM whenever the program needs it, and by assumption, this allocation will always succeed. A computer with more RAM than the memory requirements of a program has effectively infinite RAM, and therefore no simulation is needed.

Sure, the statement may be obvious, but it's also useful, because the null garbage collector is both very easy to analyze yet very different from garbage collectors you're more accustomed to seeing. You can therefore use it to produce results like this:

A correctly-written program cannot assume that finalizers will ever run at any point prior to program termination.

The proof of this is simple: Run the program on a machine with more RAM than the amount of memory required by program. Under these circumstances, the null garbage collector is a valid garbage collector, and the null garbage collector never runs finalizers since it never collects anything.

Garbage collection simulates infinite memory, but there are things you can do even if you have infinite memory that have visible effects on other programs (and possibly even on your program). If you open a file in exclusive mode, then the file will not be accessible to other programs (or even to other parts of your own program) until you close it. A connection that you open to a SQL server consumes resources in the server until you close it. Have too many of these connections outstanding, and you may run into a connection limit which blocks further connections. If you don't explicitly close these resources, then when your program is run on a machine with "infinite" memory, those resources will accumulate and never be released.

What this means for you: Your programs cannot rely on finalizers keeping things tidy. Finalizers are a safety net, not a primary means for resource reclamation. When you are finished with a resource, you need to release it by calling Close or Disconnect or whatever cleanup method is available on the object. (The IDisposable interface codifies this convention.)

Furthermore, it turns out that not only can a correctly-written program not assume that finalizers will run during the execution of a program, it cannot even assume that finalizers will run when the program terminates: Although the .NET Framework will try to run them all, a bad finalizer will cause the .NET Framework to give up and abandon running finalizers. This can happen through no fault of your own: There might be a handle to a network resource that the finalizer is trying to release, but network connectivity problems result in the operation taking longer than two seconds, at which point the .NET Framework will just terminate the process. Therefore, the above result can be strengthened in the specific case of the .NET Framework:

A correctly-written program cannot assume that finalizers will ever run.

Armed with this knowledge, you can solve this customer's problem. (Confusing terminology is preserved from the original.)

I have a class that uses Xml­Document. After the class is out of scope, I want to delete the file, but I get the exception System.IO.Exception: The process cannot access the file 'C:\path\to\file.xml' because it is being used by another process. Once the progam exits, then the lock goes away. Is there any way to avoid locking the file?

This follow-up might or might not help:

A colleague suggested setting the Xml­Document variables to null when we're done with them, but shouldn't leaving the class scope have the same behavior?

Bonus chatter: Finalizers are weird, since they operate "behind the GC." There are also lots of classes which operate "at the GC level", such as Weak­Reference GC­Handle and of course System.GC itself. Using these classes properly requires understanding how they interact with the GC. We'll see more on this later.

Unrelated reading: Precedence vs. Associativity Vs. Order.

Footnote

¹ Note that by definition, the simulation extends only to garbage-collected resources. If your program allocates external resources those external resources continue to remain subject to whatever rules apply to them.

• #### How to edit the security attributes of more than one file at a time

In Windows XP, you could select multiple files, right-click them, then select Properties. The resulting property sheet includes a Security page which lets you edit the security attributes of those files. But when you repeat this exercise on Windows Vista or Windows 7, the Security page is missing. Why doesn't Explorer let you edit the security attributes of more than one file at a time?

Windows might need to display an elevation prompt if any of the files in the collection require administrator privileges in order to modify the security attributes. The security prompt needs to tell you why you are elevating, but if you selected twenty files, there isn't room to display all twenty of them in the elevation dialog. Truncating the results means that users may be tricked into changing the security of files they didn't intend. "Grant everyone full access to X, Y, Z, and 17 other files?" How do you know your multiselect didn't accidentally include MergerPlans.doc? (Maybe there's some malware that waits for people to change security on multiple items and quietly sneaks NTOSKRNL.EXE into the file list.) Alexander Grigoriev says, "Holding forever to dangerous features is BAD BAD BAD."

If you need to modify the security attributes on a whole bunch of files, you can use the CACLS program, one of the command line tools that messes with security descriptors. If you want to modify the attributes of all the files in a directory tree, you can edit the security attributes of the root of the tree and indicate that you want to propagate inheritable attributes.

Pre-emptive hate: "I hate Microsoft for removing this feature." (Okay, that was too tame. A PROPER HATE REQUIRES SENTENCES IN ALL-CAPS.) And you wonder why I don't do Tips/Support topics often. Whenever I provide a tip that lets you work around something, everybody rants about the problem the workaround exists to address.

• #### The frustration of people who are not interested in why something works but only interested in the magic phrase they need to type

It's frustrating when people who are presumably smart (or who are at least pretending to be) have a problem and are satisfied to receive the magic phrase they need to type with no interest at all in understanding why the magic phrase works. For example, here's a question sent to an internal mailing list for users of something I'll call Program Q.

From: X

Why is it that after I use program Q to create a table, nothing else works? Here's a batch file I've written:

q create table newtable
pause
q create table newtable2


The pause command never executes; in fact, nothing in the batch file executes after the first line. How can I create multiple tables from a batch file?

My psychic powers didn't need very much charging up to solve this one. Program Q is a popular one, and some teams like to create a wrapper around it for whatever reason.

My psychic powers tell me that the first "q" on the path is not q.exe.

Another person on the mailing list knew what I was getting at and picked up the ball.

From: Y

Try using call q create table newtable instead.

(Maybe you too can figure out what my psychic powers told me the problem was.)

The response:

From: X

Thanks, that did the trick. I put a call in front of the first line and now the entire batch file runs.

I replied:

Dear X. Please confirm that the first q on the path is in fact a batch file, in order to confirm that you understand the reason why you were encountering the problem, that it has nothing to do with Program Q, and that you understand why the fix works. Don't just copy the answer from your neighbor.

I've already decided that I'm going to blog about people who accept an answer without bothering to understand why it works. Here's your chance to at least look good when that blog entry comes out.

There was no response.

Update: This was a mailing list for a programmer's tool. And if you're a programmer, you'd better understand what you're doing when you do it, not just cargo-cult your way through your job. Especially since this particular problem had nothing to do with Program Q in the first place. (On the other hand, I don't blame non-programmers for being satisfied with magic phrases.)

• #### The evolution of mascara in Windows UI

The "look" of the Windows user interface has gone through fashion cycles.

In the beginning, there was Windows 1.0, which looked very flat because screen resolutions were rather low in those days and color depth was practically nonexistent. If you had 16 colors, you were doing pretty good. You couldn't afford to spend very many pixels on fluff like borders, and shadows were out of the question due to lack of color depth.

The "flat look" continued in Windows 2.0, but Windows 3.0 added a hint of 3D (notice the beveling in the minimize/maximize buttons and in the toolbar buttons on the help window).

Other people decided that the 3D look was the hot new thing, and libraries sprung up to add 3D shadow and outlining effects to nearly everything. The library CTL3D.DLL started out as just an Excel thing, but it grew in popularity until it became the "standard" way to make your dialog boxes "even more 3D".

Come Windows 95, even more of the system had a 3D look. Notice the beveling along the inside edge of the panes in the Explorer window. Furthermore, 3D-ness was turned on by default for all programs that marked themselves as "4.0"; i.e., programs that were designed for Windows 95. For programs that wanted to run on older versions of Windows as well, a new dialog style DS_3DLOOK was added, so that they could indicate that they wanted 3D-ization if available.

And if the 3D provided by Windows 95 by default wasn't enough, you could use CTL3D32.DLL to make your controls even more 3D. By this point, things started getting really ugly. Buttons on dialog boxes had so many heavy black outlines that it started to look like a really bad mascara job.

Fortunately, like many fashions that get out of hand, people realized that too much 3D is not a good thing. User interfaces got flatter. Instead of using 3D effects and bold outlines to separate items, subtler dividers were used. Divider lines became more subdued and sometimes disappeared entirely.

Microsoft Office and Microsoft Money were two programs that embraced the "less is more" approach. In this screenshot from Microsoft Money, observe that the beveling is gone. There are no 3D effects. Buttons are flat and unobtrusive. The task pane separates itself from the content pane by a simple gray line and a change in background shade. Even the toolbar has gone flat. Office 2000 also went largely flat, though some 3D effects linger, in the grooves and in the scrollbars (not visible in picture).

Windows XP jumped on the "flat is good" bandwagon and even got rid of the separator line between the tasks pane and the contents pane. The division is merely implied by the change in color. "Separation through juxtaposition."

Office XP and Outlook 2003 continue the trend and flatten nearly everything aside from the scrollbar elements. Blocks of color are used to separate elements onscreen, sometimes with the help of simple outlines.

So now the pendulum of fashion has swung away from 3D back towards flatness. Who knows how long this school of visual expression will hold the upper hand. Will 3D return with a vengeance when people tire of the starkness of the flat look?

• #### The procedure entry point SHCreateThreadRef could not be located...

Some people smarter than me have been working on this problem, and here's what they figured out. First, I'll just reprint their analysis (so that people with the problem and are searching for the solution can find it), and then we can discuss it.

Update (18 October 2005): The official version of this document is now available. Please use that version instead of following the steps below, which were based on a preliminary version of the instructions.

If you receive an error message: "Explorer.EXE - Entry Point Not Found - The procedure entry point SHCreateThreadRef could not be located in the dynamic link library SHLWAPI.dll", this information will help resolve the issue.

This appears to have been caused by the following sequence of events:

1. You installed Windows XP Service Pack 2
2. The installation of Service Pack 2 failed due to a computer crash during the installation which resulted in the automatic Service Pack Recovery process. On next boot, you should have received an error message telling you that the install failed, and that you need to go to the control panel and uninstall SP2 and then try re-installing it. This message may have been dismissed accidentally or by another individual using your computer. In any event, the Service Pack recovery process was not completed by uninstalling the service pack from the Add/Remove Programs control panel, and the system is consequently in a partially installed state which is not stable.
3. You then installed the latest security update for Windows XP, MS04-038, KB834707. Because your system is still partially SP2, the SP2 version of this fix was downloaded and installed by Windows Update or Automatic Updates. However, the operating system files on the system are the original versions due to the SP Recovery process. This results in mismatched files causing this error.

To recover the system, carefully perform the following steps:

1. Boot normally and attempt to log in to your desktop. At this point you should get the error message listed above.
2. Press Control+Alt+Delete at the same time to start the Task Manager. (If you are using classic logon, click the "Task Manager" button.) You may get additional error messages but Task Manager will eventually start.
3. On the menu bar, select File and then New Task (Run).
4. Type in control appwiz.cpl into the new task box and hit OK. You may get additional errors that can be ignored.
5. The Add/Remove Control Panel should now be running. You can close Task Manager.
6. Near the bottom of the list, find the entry titled "Windows XP Hotfix – KB834707".
7. Click on it and click the "Remove" button. It will take some time to complete. Once the "Finish" button is visible, click on it and reboot your system. If you get messages about additional software or hotfixes installed, you can safely ignore them.

Do NOT stop now! Your system is still in the "failed SP2 install" state. You MUST complete the SP2 uninstall, and then re-install SP2.

2. Click on Start and then Control Panel.
3. Click on the Add/Remove programs item.
4. Near the bottom of the list, find the entry titled "Windows XP Service Pack 2".
5. Click on it and remove Service Pack 2. You may get a warning about software you have installed after SP2. Make a note of it as you may need to reinstall some of them after the uninstall operation.
6. After Service Pack 2 has been successfully removed, you should visit http://www.microsoft.com/sp2install for instructions on installing Service Pack 2. You can get SP2 from http://windowsupdate.microsoft.com.
7. After Service Pack 2 has been successfully re-installed, you should re-visit Windows Update to get the proper version of the latest critical security updates.

FAQ:

Q: I don't believe I am in the "partially installed SP2" state. Is there any way to check that?

A: After step 7, your system should be able to log in. There are several ways to check.

1. Open the file c:\windows\svcpack.log, and scroll to the very bottom of the file. About 10 lines from the end, you should see:
0.xxx: Executing script \SystemRoot\sprecovr.txt
0.xxx: In cleanup mode. System will not be rebooted.

If you have these lines in svcpack.log, and you did not uninstall Service Pack 2 in Add/Remove Programs, you definitely have a machine in this partially installed state.
2. Click on the Start button, then Run, and type winver, then click OK. If the version is "Version 5.1 (Build 2600.xpsp_sp2_rtm.040803-2158: Service Pack 2" then you have the correct SP2 install. If, however, it has a number that is less than 040803 after the xpsp2, such as "Build 2600.xpsp2.030422-1633 : Service Pack 2" then you definitely have a machine in the partially installed state. [Corrected typo in version numbering, 11am.]

Notice that the default answer to every dialog box is "Cancel". The Service Pack setup program detected a problem and gave instructions on how to fix it, and yet people just ignored the message.

The result of not fixing the problem is that you are left with a machine that is neither Service Pack 1 nor Service Pack 2 but instead is a Frankenstein monster of some files from Service Pack 1 and some files from Service Pack 2. This is hardly a good situation. Half the files are mismatched with the other half.

There was enough of Service Pack 2 on your machine that Windows Update downloaded the Service Pack 2 version of the security patch and tried to install it. This made a bad situation worse.

What's the moral of the story?

First, that users ignore all error messages. Even error messages that tell how to fix the error! Second, that ignoring some error messages often leads to worse error messages. And third, that once you get into this situation, you're off in uncharted territory. And there are only dragons there.

(These are the types of problems that are nearly impossible to debug: It will never happen in the test lab, because the test lab people know that when an error message tells you, "The install failed; you need to do XYZ to fix it," you should do it! All you can work from are descriptions from people who are having the problem, and a lot of creativity to try to guess "What happened that they aren't telling me?")

Page 5 of 453 (4,528 items) «34567»