Geek Tips

Aborting Forced Shutdown

It’s interesting to see this post about a stubborn, automated reboot in Vista. I haven’t setup my Vista testbed machine yet, but I’ve seen a shutdown countdown on older Windows. You can even provoke it by accidentally ending the wrong process.

That’s how I learned about “shutdown /a” for aborting such a thing (by being quick with the Run line). I wonder if it works in Vista as well. This KB article describes the switches as applicable to Windows 2000,

Guess I’ll find out, if Vista does the shutdown thing to me, or if I can provoke it.

XP SP2 Office 97 Setup Failure and Registry Adventures

I recently had to setup Office 97 on a Windows XP machine that came with the dreaded SP2, making it impossible to avoid.

Before setup could complete, it gave an error registering htmlmarq.ocx and ended, saying setup did not complete successfully. Yet Word would run, it seemed.

You can’t always trust overt impressions. When a document management program attempted to open a document and launch Word through OLE automation (I know, COM automation), it turned out the VB environment of Word hadn’t installed and no could do. Darn.

So I tried again to make it work. I renamed the Office registry keys. I renamed the Microsoft Office directory. I installed again. Removed and installed. No dice. Duh. I finally thought to Google htmlmarq.ocx to see what I found, which led me rapidly to this page that contained a solution and was an eye-opener about something Microsoft does in XP, if not other operating systems.

Actually, I just checked Windows 2000 and it does have the same registry section, which leads to more commentary below, not directly related to the Office 97 setup.

Anyway, if you can’t get the Office 97 setup to complete on XP, you will need to run Regedit. That is, Start, Run, type “regedit” without the quotes, and press Enter or click OK. That will bring up the registry editor.

Be careful what you do in the registry editor. You can completely hose your system if you change or delete the wrong thing.

You will need to go to the following key:
HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionImage File Execution Options

That is, on the left you will initially see some top level keys under “My Computer.” Expand the one labeled HKEY_LOCAL_MACHINE. Under that will be more, to be expanded out in tree fashion: Software, Microsoft, Windows NT, Current Version, Image File Execution Options.

At that point you will see a series of additional keys. For the Office 97 problem, look for htmlmarq.ocx and htmlmm.ocx keys. If you click on them, based on my experience, there will be no associated value over on the right. I gather the idea is by putting the item in Image File Execution Options without any options specified, you block it entirely. Was that the intent? I don’t know.

Rename them so they no longer match the original names. Afterward, the setup should complete successfully. It worked great for me, so I thought it would be nice to add visibility to the solution.

For what it’s worth, this had no bearing on the Outlook install of additional components that I wrote about previously. That stayed broken, and I did not find I needed to investigate further as everything worked as required in Outlook.

I poked around and found the same section exists in Windows 2000, as indeed it does in the whole NT OS family. Everything in there had values, of either “ApplicationGoo” or “DisableHeapLookAside.” The ApplicationGoo one sounds completely silly, and is notably applicable to install.exe, setup.exe and setup32.dll.

Naturally I Googled it, and found there is more to learn about the topic here, if not an exact answer to what ApplicationGoo is all about.

Finally, on Windows 2000 I did a test. I created an application named testaroo.exe, that simply pops up a message box saying “testaroo.” Then I added a key named testaroo.exe to that section and tried running testaroo.exe. It worked. So the key does nothing to prevent a program from running. Which makes sense, given the problem with htmlmarq was registering. I’m not going to take a test that far just now.

Advice On Linux?

Andrew Cory, posting at Dean’s World, is looking for advice about what Linux distro to install, and has some related questions about functionality.

One of them I think is especially good:

I’ve had past experiences with Linux where there was no good way of doing file management. Windows Explorer represent the minimum level of functionality I am interested in…

Yeah, really. That is precisely the kind of thing I want, and found lacking, in Linux in my modest exposure to it. Has there been any improvement along those lines? My reaction to Linux, apart from the GUI and program availability making it seem impressively close to ready for prime time to me, was “where are my drive letters?” Talk about a changed conceptualization.

Malware Slayer

Jay Tea describes an experience cleaning up malware, that is, adware and spyware, on an extended family computer. There’s that family tech support thing again. I can’t blame him for feeling dirty, as it was a particularly bad infestation.

He took a somewhat different approach from the hardcore one here and for that matter, here. Yahoo’s toolbar? I’d never have thought to do that.

One thing though; installing Firefox is priceless. It goes most of the way toward preventing the problem from happening again. And again and again and again.

PHP and MySQL Reading

Recently I have been looking through the SAMS book Teach Yourself PHP, MySQL and Apache, by Julie C. Meloni, and from what I have seen it is most excellent. Then again, books published by SAMS tend to be.

I say “looking through” because, hey, who sits and reads a computer book cover to cover, in order, unless maybe it’s by Alan Cooper (speaking of Cooper, this homonym list is cool).

Well, strike that. I read Code Complete cover to cover. Rob, who is one of the so far mostly theoretical contributors to this site, recommended it to me way back when, and I certainly concur. It’s just not what you’d call light reading.

Anyway, I was interested in PHP programming and making it talk to MySQL so I could extend what I can do with blogs, maybe apply some of it to web site building in general, and possibly create online applications, if only for personal or internal business use. This blog uses PHP and a MySQL database.

As a relatively introductory text, there is no doubt much to know that it doesn’t cover, but there are tremendous resources online once you know where to start. The PHP prgramming parts flow in a logical order and are easy to follow. All the more so if you have knowledge of an existing programming language.

It also jumps right into practical applications; mailing list, online address book, discussion forum, storefront, shopping cart, and calendar. I find that kind of thing cool.

Anyone Remember…

I did an unexpected bit of malware cleanup today, and in the process found myself in the windows and then the system32 directory identifying offending DLL, EXE, DAT, INI, LOG and TXT files, primarily the first three, using old-fashioned DOS commands. You know, dir/ah for hidden files, dir/ah/p to pause if too many for one screen, dir/ah *.dll for the hidden DLL files, and also dir/od or dir/o-d/p in whatever combinations, to show newest files last, or first and pause after a screen, respectively.

Since it was clear that the bunches of oddly named files that had hidden and system attributes and very recent dates were put there by malware, active currently or not, but in case of errors, I was renaming them.

After a bit of:
attrib -s -h malfile.dll

ren malfile.dll malfiledll.not

I got tired of typing so much. So I spontaneously remembered my batch file skills, duh, and went to town. Better yet, I used the first way I ever learned of creating a new batch file, before I even learned (for shaky values of “learned” since it was so tricky) to use Edlin for editing them.

Anyone remember “copy con”?

It’s just the copy command, but applied to the “console to write a file. So at the prompt I typed:
copy con atsh.bat

After pressing enter, the regular prompt, C:yada yada>, goes away. Continuing, I typed:

attrib -s -h %1
ren %1 %1.not

Then pressed Ctrl-Z, which displays as ^Z, and pressed enter to save the file.

%1 Is the parameter passed into the batch file. So at the command prompt I could then type:

atsh aq6zyd.dll

That removed the system and hidden attributes and renamed the file to aq6zyd.dll.not, which is not precisely the naming convention I’d been using, but it still makes them of a nonsense “type” and clearly indicates they are the ones I renamed, whether for renaming back if mistaken, or deletion when clearly not needed.

The system in question was a serious mess. At first I couldn’t get into Control Panel. I never could get into Services, because it thinks IE 5.5 or higher is not installed.

Of course, this system is weird in that it’s XP Home and even when I am in safe mode command prompt as administrator, it locks me out of accessing some files and has some of the malware files in memory. The machine needed to be back in a hurry, so I returned it with no apparent malware running, but without certainty that it’s not there or isn’t going to come right back. It’s just not crippled and ought to go for a while. The thing really should be fdisked and reinstalled fresh.

The whole thing brought back memories of my early computer usage and messing with batch files. When the OS was DOS, or DOS and Windows 3.1, batch files really mattered. Before DOS Edit, I used copy con all the time.