Fixing Windows XP file associations

I installed PowerArchiver on my Windows XP machine at work the other day because I wanted to read a .tar.gz file. The default installation of PowerArchiver takes over all of the compressed file associations on the computer, making PowerArchiver the program that opens all compressed file formats that it understands (which is quite a few). This all works great until you uninstall PowerArchiver. Then you lose your file associations.

I uninstalled PowerArchiver shortly after I used it for the .tar.gz file. Today I wanted to create a zip file, but the option to create a new compressed (zipped) folder didn’t appear on the Windows Explorer menu. Not good. Google to the rescue.

A search for “windows xp zip restore association” returned a link to Doug Knox’s Windows XP File Association Fixes. A quick download of the ZIP Folder Association Fix, and I was back in business.

If you’re looking for Windows tips, tweaks, and tricks, check out Doug’s Windows Tweaks and Tips. There is a lot of good stuff there. But be careful. You should have some idea of what you’re doing before you start applying some of those fixes.

Upgrading to Windows XP

After a little over four years, Debra outgrew the 6 gigabyte drive on her machine.  The darn thing’s been giving her trouble for months, but she wouldn’t let me do anything about it.  I tried to defragment the drive, but the Windows 98 defragger kept restarting for some reason and wouldn’t ever actually defragment anything.  When the system started telling her that there weren’t sufficient resources to run Word, it was the last straw.

A trip to Fry’s is always a good thing.  I stopped there on Thursday with about an hour to kill before a dinner meeting.  I was looking for a 30 gigabyte drive to put in Debra’s machine, but the smallest Fry’s had was a 40 gigabyte Maxtor.  I thought $75 was pretty steep, but since that was the cheapest they had, I took it to the register.  The guy at the door who checks receipts noticed the 40 gigabyte drive and informed me that the 80 gigabyte Maxtors were on sale for $50.  Twice as much for a third less.  So I returned the 40, picked up an 80, got the credit, and headed out.

Saturday morning I backed up all of Debra’s data on two CDs, opened the computer, and installed the new drive.  Then I installed Windows XP Home along with service pack 2 and all the other critical updates.  Installing software took most of the day, and even overflowed into today a bit.  But now Debra has Windows XP and about 70 gigabytes of free space.  It’s surprising how much faster XP is compared to Windows 98.  I suspect the new drive is faster, and I know for sure that the page file on the XP system isn’t fragmented like the Windows 98 page file was.

Whenever I upgrade to a new operating system, I buy a new hard drive.  The old drive stays in the system as the secondary device (“D drive”) so I have a live backup of the old data.  That’s saved my bacon numerous times when I’ve forgotten to back up some critical data.  I must have hooked up the IDE cable wrong this time, because Windows XP decided that the new drive (the boot device) should be drive F:, and the old drive was C:.  I managed to change the drive letter for the old drive (it’s K: now), but Windows won’t let me change the drive letter of the boot device.  Of course, by the time I realized this, Windows XP was fully installed and I wasn’t about to go through that again!

In any case, we now have a Windows XP box in the house with SP2.  It’s a huge improvement over Windows 98.  We’ll see how it does.  If I run into any problems, I’ll be sure to report them here.

Access to Windows shares problem solved

A Google search for “konqueror windows share” revealed the Access to Windows Shares article on SuSE’s site, which gives instructions for the command line and Konqueror on SuSE versions 8.1 and later.  The command line setup was painless, and in a matter of a few minutes I had full access to my Windows shares both from the command line and from Konqueror.  The basic idea is to create a directory on the Linux box and then map the Windows share to that directory with this mount command:

mount -tsmbfs //server/share /linuxpath/dir

After that, I could just browse to /linuxpath/dir and I was able to access the files on the Windows share.  I can make the mapping permanent by adding the mount point to the /etc/fstab file, the only drawback being that I need to identify each individual share in that file or use the administrative shares (C$, D$, etc.).

Adding browse capability so that I can browse for machines and shares from Konqueror was a little more involved.  I had to start YAST again and install a couple more packages, then configure LISa, the LAN Information Server.  On my first try I could access the Windows shares only by IP address, apparently because I didn’t instruct LISa to send NetBIOS broadcasts to locate servers.  I had to install the Samba server package and enable it before I could access by machine name.  This is hinted at on the Web page, but not explicitly stated.  I’m somewhat surprised that I have to enable the Samba server in order for this to work.  I wonder if the reason is that the program that LISa uses, nmblookup, is part of the Samba package.  Perhaps it’s possible to install that program by itself?

Accessing Windows shares from Linux

More experiments on the Linux front.  Today I thought I’d figure out why I can’t access my Windows shares from my SuSE 9.1 system.  Konqueror, the KDE file manager, dies unexpectedly when I attempt to access one of the shares.  I managed to get Mandrake 9.2 running on my other lab computer here, and am able to access the shares from Konqueror without trouble.  So, there’s something wrong with the SuSE configuration.  Figuring I might as well start at the beginning, I tracked down the Samba documentation and learned how to use it from the command line.  With the command:

smbclient //server/share -Userver/jmischel

I was able to connect to the Windows share from my SuSE system.  I can get a directory listing and read the files.  But even after connecting with smbclient, I’m unable to connect using Konqueror.  So that means there’s a problem with the Konqueror configuration, or with the interface between Konqueror and Samba.  I still haven’t tracked that one down.

Windows’ broken search tools

I have a standard set of tools that I usually install on any machine that I’ll be working with on a regular basis. This set of tools is a hodge podge of stuff I’ve collected over the years, either written by me or acquired by other means.  The tools include a text search utility (grep), a hex file viewer (my home-grown DUMPJ program), an ASCII chart display (surprisingly, I still use that), file comparer, and various other odds and ends that I’ve found useful over the years.  Some of these tools are showing their age and don’t work particularly well with modern systems, but most of them are still quite useful.  I haven’t installed those tools on my development machine at work because they frown on “unauthorized” software installs.  I’ll eventually get the OK to install them here, but in the meantime I’m limited to what comes with Windows and Visual Studio .NET.

My task today was to find all the “RAISERROR” statements in all of the project’s stored procedures, which are stored as text files in one of the project directories.  “If I had grep,” I thought, “I’d just use it in that directory.”  Since I don’t have grep, I tried to use Windows Explorer.  No dice.  It reported no matches when I know for a fact that at least some of the files contain that statement.  Then I found the Windows FINDSTR command, which is something of a bastardized grep.  After fooling with the syntax for a while, all to no avail, I’d almost given up.  Then it occurred to me that the stored procedures are saved in Unicode rather than plain old ASCII text.  Sure enough, if I opened a file in Notepad and saved it as straight text, FINDSTR and Windows Explorer worked as expected.  So now I’m sitting here wondering how Microsoft managed to ship a Unicode-enabled Notepad with Windows 2000, but still hasn’t managed to add Unicode support to their text search programs.

I did eventually solve my problem, by the way. I used the “Find in Files” functionality of Visual Studio .NET to find what I needed.  I find it incredibly annoying to start Visual Studio in order to search for files that contain particular strings, especially when Microsoft is beginning to use Unicode in many more situations.  My hope is that Longhorn’s tools will fix this shortcoming.

Stop the registry madness!

I thought that everybody, Microsoft included, admitted that the Windows Registry was a really bad idea that looked good on paper.  The number of things that can go wrong with a single file containing all system and program settings is astronomical, and 7 years or more of tweaking and patching hasn’t made it any better.  The IIS team apparently agreed, because they decided to move most of their configuration to a separate file called the MetaBase.  Not that the MetaBase is such a good idea, either, being a weird indexed proprietary format, but at least it reduces the chance of losing your IIS settings when the Registry gets corrupted.

But, no, programs are still storing all manner of data in the Registry.  Today’s evildoer?  Outlook Express.  Would you believe that Outlook Express stores its message rules (blocked senders and other filtering rules) in the Registry?  No wonder I couldn’t find them by searching the hard drive.  You’d think that, since Outlook Express doesn’t provide a way to export or import message rules, it’d at least put them into a file so that you could back them up.  But, no.  In order to back up your message rules you need to start the Registry Editor,  navigate to the proper key, and then select “Export Registry File” from the File menu.  The proper key, by the way, is:

HKEY_CURRENT_USER\Identities\{GUID}\Software\Microsoft\Outlook Express\5.0

The {GUID} part is replaced by the globally unique identifier of your identity.  Likely there will be only one to select from.

In there, you’ll find keys for Blocked Senders, Rules, and Signatures.  Export what you want to a .reg file (which is text format), and you can edit to your heart’s content using Notepad or your favorite text editor.  If you want to import the rules to another computer (or for another user), then simply log in to the machine where you want to import the rules, change the {GUID} portion in the .reg file to match the GUID for the identity on that machine (get it from the Registry Editor), and then select “Import Registry File” from the File menu.  Note that this may very well overwrite any existing rules, so be careful.  It’s probably a good idea to back up your existing rules before you do the import.

My friend Jeff Duntemann has pointed me to PocoMail, which I need to try.  Not only are the message rules stored in plain ASCII text files, but it also looks like the program’s message storage is much more reasonable.

Problems installing Windows 95

Today I had to install Windows 95 at the office in order to test our product.  We don’t “officially” support Windows 95 anymore (heck, even Microsoft doesn’t really support it), but you’d be amazed at how many companies still have thousands of machines running Windows 95.  So we make at least a token attempt to assure that our product runs on that platform.

As it turns out, installing Windows 95 is not trivial, especially on a computer that has recently had Windows 98 or Windows 2000 installed on it.  95 will notice the newer version of Windows and refuse to install over it.  What you need is a Windows 95 boot disk, with CD-ROM driver.  Try finding one of those laying around the office.  Do you remember how to configure MSCDEX.EXE?  I thought not.

But let’s say, for argument’s sake, that you were able to get Windows 95 installed and now you want to hook your computer up to the network.  But the network card you installed in the computer was built in 1999 and Windows 95 doesn’t recognize it.  Where to find a driver?  The Web, of course.  Just find the manufacturer and model number on the network card, find the manufacturer’s web site, and download the driver.  Simple.  Clean.  Neat.  Except the @#$% manufacturer decided not to print any useful information on the card!  Now there’s a good idea!  What idiot thought that up?  Fortunately I found an old 3Com card that had the model number on it and I was able to download the driver to a diskette and install it on the machine.  I still don’t know who made the other card.  I guess I could drop it into a Windows 2000 machine and let the New Hardware Wizard tell me.  But I figure if the manufacturer is too ashamed of the card to print their name on it, I probably don’t want it in my computer.

I’ve run into this problem with all types of cards over the years.  Is it really that expensive to print a few more characters on the board?  The lack of identifying characteristics on these boards makes it impossible to use them in many cases.  Perhaps it’s the manufacturers’ way of getting us to buy new hardware.  

Sometimes I just shake my head in wonder.

Windows network load balancing

I had occasion over the last couple of days to work with the Network Load Balancing functionality that’s built into Windows 2000 Advanced Server.  I’m impressed at how painless it is to configure and operate.  Apart from a few ambiguities in the online help, things work exactly as I expected.  I haven’t yet tested the performance of my load balanced web servers except to show that the system does indeed work, and has somewhat higher throughput than the single web server.  For a large volume production web site, I’d rather go with a hardware load balancer/director, but for testing software in a load balanced environment, Microsoft’s NLB implementation is ideal.

More Windows assembly language programming

In 1983 I wrote a hex file dump program in Pascal MT+ for my CP/M computer.  Over the next four years, I added a few features to the program and turned it into a hex dump and patch utility.  The program’s interface has been pretty much static since 1987, but I’ve re-implemented it in many different languages on several different operating systems.  Whenever I start learning a new programming language or start programming for a new operating system, I port this program. I’ve coded the program in Turbo Pascal, BDS C, Turbo C, 8086 assembly language for DOS, FORTRAN, COBOL, Prime Macro Assembler, Delphi (32-bit Windows console application), and most recently 80386 assembly language for Windows (again a console application).  I’ve started Windows GUI conversions at least three times, but the program just doesn’t seem to want to be a GUI application.  Oh well.

So why do I keep writing the same program?  Simple.  When I’m learning a new programming language or operating system, I need to focus on the system rather than on the problem I’m solving.  “Hello, world” and similar one-concept programs are fine as far as they go, but at some point you have to tackle a real program before you can feel comfortable working in a new environment.  My dump/patch program is such a program.  It forces me to learn how to obtain the command line parameters, work with the screen, position the cursor, allocate memory, and perform file I/O.  The nice thing is that I understand the algorithms so I can concentrate on learning the language or operating system without having to worry about solving the underlying algorithmic problem.  One thing at a time when you’re learning.

You can find the 16-bit DOS and 32-bit Windows console versions, with assembly language source, on my downloads page.

Next stop:  a Linux version, first in C and then in assembly language.

Assembly language programming in Windows

I wrote my first assembly language program 20 years ago, and up until about 5 years ago I was always doing something or another in assembly language.  Having finished most of my other projects, I’ve started brushing up on my ASM skills again, starting with porting an old hex dump/patch program from 8086 DOS assembly language up to a 32-bit (386 or Pentium, I haven’t yet decided) Windows console application.  Once that’s finished, I’ll probably port the program to Linux as well.

Writing to the Windows API from assembly language is an odd experience.  Traditionally, assembly language programs “talk to the hardware,” or interface with the operating system at a low level.  But the Windows API is a bunch of high-level procedure calls, and the operating system controls all of the hardware.  I’m directly controlling the CPU, true, but everything else (video, keyboard, sound, I/O ports, etc.) is accessed through a high-level procedure call.  It’s an entirely different kind of assembly language programming.  Interesting though, and very instructive.