Welcome to MSDN Blogs Sign in | Join | Help

Unix Time and Windows Time

A little note in Portfolio magazine caught my attention: On Friday, February 13, at 23:31:30, the Unix time value with be 1234567890.  This got me thinking about when the Windows time value will reach that serendipitous number, and led to some research on MSDN

Time is a complicated topic - part of it is that there are so many different MSDN-documented interfaces that return time, including SQL, Java Script, WBEM, MFC, .NET, etc.  I found this topic which gives a good overview of the various types of times in Windows.  Unlike Unix, where there is pretty much a simple time_t structure that contains a 32-bit signed number.  It might seem odd that Unix chooses to reduce the span of time it can represent by half by making the value signed rather than unsigned, but this is an artifact of the baseline used - January 1, 1970.  So allowing for negative values allows times prior to 1970 to be represented on Unix (an interesting article about Unix time notes that Unix co-inventor Dennis Ritchies birthtime is the Unix time value -893,400,000).

The basic idea of representing time on computers is pretty simple - pick a baseline date/time and then count some increment of nanoseconds, milliseconds, or seconds since then as a numerical value.  The trick is in picking the baseline, and accounting for all the oddities of leap years, leap seconds, changes in calendar, etc.  But basically it comes down to some number of time units from the baseline, so when Portfolio said the Unix time will be 1234567890, it means it will have been 1,234,567,890 seconds since the Unix baseline of January 1, 1970 on February 13 of this year.  Boy, how those billion plus seconds just flew by!

But Windows is more complicated (natch, some would cynically say).  MSDN notes: "There are five time formats. Time-related functions return time in one of these formats. You can also use the time functions to convert between time formats for ease of comparison and display. The following table summarizes the time formats.

Format Type Description
System SYSTEMTIME Year, month, day, hour, second, and millisecond, taken from the internal hardware clock.
File FILETIME 100-nanosecond intervals since January 1, 1601.
Local SYSTEMTIME or FILETIME A system time or file time converted to the system's local time zone.
MS-DOS WORD A packed word for the date, another for the time.
Windows DWORD The number of milliseconds since the system booted; a quantity that cycles every 49.7 days.


So what is called here Windows time (and so sounds like the parallel to Unix time) actually is dependent on when you booted your computer - so if you leave your machine running for a bit over two weeks, your Windows time will reach the magic 1234567890 value (actually at 14 days, 6 hours, 56 minutes).

The System time (which in usage is actually parallel to how Unix uses time_t and what the article is calling Unix time) is a structure on Windows, broken into WORD (16-bit on Win32) values for each component, i.e. hour, minute, etc.  The system queries the realtime clock built into the processor and generates this structure from it; how exactly the CPU maintains that value is processor-dependent (part of the BIOS is making that translation).

So the closest thing to Unix time - the idea of a single number representing actual date and time, and so could reach a "magic value" like 1234567890 - is FILETIME. This is what is stored in the filesystem.  I suspect it was created because it is less efficient to just store a SYSTEMTIME structure on disk (since it is composed of eight 16-bit values, or 128 bits of data, while FILETIME is a 64-bit value; doesn't sound like a lot of difference, but when you have millions of files, those bits add up... :))

FILETIME "contains a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC)."  So here very visibly is the difference between a 32-bit value and a 64-bit value.  Remember Unix is counting seconds since January 1, 1970; Windows is counting nanoseconds (a billionth of a second - nine orders of magnitude more precise than the Unix time) since a date over three centuries earlier - and still can store it in a single integer value because it's using a 64-bit value rather than a 32-bit value.  The power of exponential growth right there, ladies and gentlemen.

So when did this 64-bit value reach 1,234,567,890?  Well, recall that it is measured in 100 nanosecond intervals, which are a one hundred billionths of a second, and the magic value is roughly a billion - so in fact, Windows FILETIME reached the magic value Unix will reach on Friday February 13 a little more than a one hundred seconds, or about two minutes, after midnight on January 1, 1601. 

Posted by MikeKelly | 5 Comments
Filed under: , ,

Excel Conditional Formatting Against a Goal Value

Today, for a metrics worksheet I'm doing, I had a conditional formatting problem with Excel.  I suspect this is a pretty common problem. 

I had a column of numbers showing the monthly results for a set of metrics (the rows) for this fiscal year, and I had an annual goal for each metric.  I summed up the values across the months that have passed in this FY (our FY starts in July).  I hid the columns for the months that haven't come yet.  Then I have an annual goal for each metric.

I want to use conditional formatting to show whether I am on track to meet the metric.  An Icon Set format should do nicely, but at first I was puzzled because it looked like I could only use an icon set against the value itself - but in fact, I wanted to compare the value to the goal.

I realized after playing around a bit that the trick is to add a column for the icon and use a formula in that column to compare the value so far against the goal, and then format that column with the icon set, chosing "Show Icon Only" in the conditional formatting dialog.  What I end up with is something like this:

Because the value in the Total column (I'm not dealing with conditional formatting for the metrics where I'm showing averages) is only for a part of the FY, but the total goal is for the entire year, I need to scale the comparison to say whether we are on track or not.  This involves a bit of date arithmetic to figure out how far into the year we are.  Here's the formula; this complex parenthesized expression is basically figuring out how far we are into the FY, as a fraction from 0 to 1 (i.e. in the first month, we will be at 1/12).  Note that I am using TODAY() to get today's date; if instead, you wanted to make this be a specific date, i.e. the end of the month, you could create another named cell into which you enter the date for which metrics are current and refer to that in this formula instead of TODAY().

 =(((YEAR(TODAY())-YEAR(FYStart))*12+(MONTH(TODAY())-MONTH(FYStart)+1)/12)

I created a workbook with two named cells, one with the starting date of the Fiscal Year (which I named FYStart) and below it a cell with this formula in it, which I named PercentOfYear.  I can then refer to those named cells in formulas elsewhere.  This lets me reuse this sheet next year by just changing the FY start date.

Now to figuring out how far off I am from the goal.  For each row, column "N" is the value so far, i.e. the total of the values for all the months that have passed in this FY.  The "O" column will contain the icon showing on track or not.  The "P" column has the goal.  The formula for the icon column (O) is:

=(N4-PercentOfYear*P4)/(PercentOfYear*P4)

This scales the entire FY goal to what it should be this month if we are on track (this assumes the metric increases linearly each month).  We then subtract the scaled goal from the actual value, which gives us a positive value if we are ahead of the FY goal at this point, a negative number if we are below the goal at this point, and zero if we are right on target for the goal.  We then scale how far we are off from the goal by the scaled goal - so for instance, if the metric value is "2" and the goal is "5" and we are in December, we will should be at 2.5; because we are at 2, we are off by .5 or 20% of the scaled goal.

Finally, we apply conditional formatting to the cells using a custom rule.  That looks like this:


This applies a green icon if the value is zero or positive - i.e. we are on track for the goal; yellow if the value is not less than 25% below the goal at this point; red if we are further below the goal than that.

 

Posted by MikeKelly | 1 Comments
Filed under:

Business Contact Manager and Outlook 2007

My group at work has decided to use Business Contact Manager (BCM) for tracking engagements we're doing with other product groups here at Microsoft. My team is a sort of internal consulting organization focused on software development processes and tools at Microsoft.

So I went to setup BCM on my machine to play around with it.  It's been a bit of a twisty path, so I thought I'd document some of what I learned in case others run into this.  Interestingly, most of the rest of my team was able to set up without encountering this, so it's probably something weird on my machine that is causing these problems.  But it's a big world out there, so there probably are other machines that will run into some of these issues.

I'll also describe how I troubleshot some of these issues and eventually ended up with everything running.

1. Problem 1 - during install of BCM, I got the error "Setup failed to install the required component Microsoft SQL Server 2005 Express (MSSMLBIZ)".  This turned out to be that SQL Server 2005 Express was already installed on my machine (as part of Visual Studio 2008 - I suspect a number of my problems were the result of having installed VS 2008 previously) and a separate install of an unrelated product had been done with a pending reboot needed.  I had not rebooted the machine in several days and had forgotten that I had installed whatever the other thing was. When BCM comes along and sees that SQLServer 2005 Express is already installed, it invokes the SQL Server installer to set up the new instance for MSSMLBIZ - but SQL Server install refused to run because there was a pending reboot. Rebooting the computer fixed this one.  I found this by running SQL Server 2005 Express install myself (from add/remove programs in control panel) intending to remove SQL Server 2005 Express and let BCM reinstall it.  It turns out that would have worked - because I would have rebooted after doing this - but in fact was not necessary.  When I ran the SQL Server 2005 Express install from add/remove, it told me it couldn't run because of the pending reboot action - and a lightbulb went off.  I realized this was probably why BCM install couldn't run the SQLServer install either.  So I rebooted and this one was resolved.

 2. Next problem was the Office 2007 Primary Interop Assemblies (PIAs).  These are some glue between Office and .NET applications.  They also had previously been installed as part of VS 2008, so again, this shouldn't have been a problem for BCM - it should have gone to install them, seen that they were already there, and just moved on.  But there is a problem with the name of the installer file that BCM uses for these PIAs and the name that VS 2008 uses - this is described in more detail at http://jlchereau.blogspot.com/2008_04_01_archive.html.  The net effect is that BCM is trying to access O2007PIA.MSI on its installation media for these PIAs, but in fact the file that BCM ships for these is PIARedist.MSI.  If I uninstalled the PIAs and reran BCM setup, I'm sure it would work (which is probably why it works for most people), but I didn't want to do that.  Instead, I copied the entire installation tree from BCM locally to my %TEMP% directory (I was installing from a network share, but you could also do this from the CD if you're installing from CD) and then in the "OFFICE" subdirectory, I just copied the PIARedist.MSI file and made a copy named O2007PIA.MSI.  Now both files were on the installation media, and when BCM install went looking to install the PIAs that were already installed and the installer said, OK, they must have been installed from a file called O2007PIA.MSI - that file was there.  Problem resolved.

3. The next problem was a configuration error on our side - the shared BCM database on our server wasn't set up for all the users to access it.  I didn't fix that, but the guy on my team who set up the SQL Server database added our accounts to the SQL Server permissions and that solved that problem.

4. The final problem was a local database creation problem.  BCM uses SQL Server 2005 Express edition to keep a local copy of the database.  That way, if you're not able to connect to the server (e.g. you're at home, or on the road) it can still reference and make changes in the database cached locally.  Then it syncs these changes when you reconnect.  The error I received when I ran the BCM Wizard on starting Outlook after installing BCM was "Database creation was unsuccessful."  I figured this was likely a permissions error (since I know SQL Server is running fine - I confirmed that the MSSMLBIZ instance is running by going to Start / Computer, right clicking and selecting "Manage...".  From there, I looked at Services and Applications / SQL Server Configuration Manager and I see the SQL Server (MSSMLBIZ) showing as running.  I note that it is running under the account "NT AUTHORITY\NetworkService".  I went back into Outlook and tried again to to create the offline database (by clicking "OK" in the "Configure database for offline use" wizard screen) and confimed the error still occured.  I then went to start / Run and ran "EventVwr" and navigated to the Windows Logs / Application log file.  I noticed two recent errors from MSSQL$MSSMLBIZ which is my instance of local SQL Server 2005 Express running.  The error was: "CREATE FILE encountered operating system error 5(Access is denied.) while attemptin to open or create the physical file "C:\users\mike\AppData\Local\Microsoft\Business Contact Manager\MSSmallBusinessOutlook_offline.mdf'."  So that tells me that SQL Server is having permission problems with the directory C:\users\mike\AppData\Local\Microsoft\Business Contact Manager.  This is probably because it's running under NetworkService and that account doesn't have write permission in this directory.  I went back to the Start taskbar, selected Run and pasted in "C:\users\mike\AppData\Local\Microsoft" to open the containing folder.  I right clicked on the "Business Contact Manager" subfolder in this folder and clicked on Properties, then went to the Security tab.  Sure enough, no entries for NetworkService - so it will just inherit permissions based on the group hierarchy.  I'm pretty sure NetworkService isn't SYSTEM, and I doubt it's me (which is the next permission list) so it's probably getting either the Everyone or MIKE\Users permissions.  I clicked on "Users" and cliked Edit, added "Modify" permission for this group (full disclosure: I have now given every user on my machine write permission into an area of my local profile, but since it's just the BCM folder I'm not too concerned) and OKed out of these.  Went back to Outlook, clicked Next in the wizard - and voila, the database is created.

 

Posted by MikeKelly | 6 Comments

Don't Forget Those Passports!

As an experienced international traveler, I am embarrassed to admit that on a trip this weekend, I forgot my passport on an international trip. 

This past weekend was my wife’s 50th birthday and we decided to celebrate it on Vancouver Island, at the Wickinannish Inn.   We thought enough about the border crossing that we planned to drive up Friday evening and stay just south of the US – Canadian border at the Peace Arch Crossing at Blaine, WA.  We stayed at the Semiahmoo Friday night, and had a wonderful evening.  On Saturday morning, my wife, Lisa, suddenly looked at me and asked, “Do you have our passports?”  We both quickly realized that despite numerous international trips, and despite having thought enough about the border crossing to want to be close to the border on Saturday AM to avoid any delays, neither of us had remembered the all-important documents.

A quick check on the web showed that Canada doesn’t require a passport for entry, although they do like to have proof of citizenship.  We were able to talk our way past the very friendly Canadian border control agent by admitting we had forgotten our passports and showing our Washington State drivers licenses.  However, we realized we probably would not have such an easy time returning to the U.S.  Thus began a flurry of calls to try to get our passports sent to us in Canada.  Since we weren’t returning to the U.S. until Monday (and it was Saturday morning) we thought this would be no problem.

We were able to call our next-door neighbors and get them to retrieve the passports from our house.  Now all we needed was for them to FedEx them up to our hotel in Canada to arrive by Monday AM and we were good to return.  Thus began the fun.

On Bainbridge Island, where we live, there is a UPS store – I called that store and found that because we were talking about an international shipment to Canada, they couldn’t guarantee delivery until Tuesday morning – and the cost would be $86, which seemed high just for an envelope containing two passports, but we needed the passports and would gladly pay it.  But Tuesday delivery was a non-starter for us – we have children, and while we had arranged childcare for them through Monday, we were reluctant to extend that another day.  Maybe FedEx could do better – I called the 800 number and found that, yes, they could get them to Canada by noon Monday if we dropped them off at a staffed FedEx facility by 5 PM Saturday.  However, while UPS has such a facility on Bainbridge, FedEx does not – it meant finding someone to get them to Seattle.  Meanwhile, other ideas flew around – could we get someone to just drive them up to the border on Monday and meet us at the duty-free?  Who could do that?  What about a FAX of the passports – would that do?  The first morning of my wife’s birthday weekend was spent with our friends, Steve and Jody, brainstorming all this.

We found a neighbor’s daughter who was willing to take them across on the ferry to Seattle to have them  sent via FedEx to us – but to where?  Tofino, on Vancouver Island, is pretty isolated (one reason we picked it for this weekend) – could we be sure of the FedEx delivery getting there?  Maybe better to have them delivered to the airport counter for Orca Airways at Vancouver Airport – we were flying Orca from Vancouver to Tofino on Saturday, and flying back on Monday afternoon.  It seemed safer to send them there than the hotel.  However, the counter is usually not staffed until just before their daily flight to Tofino, so what would FedEx do if there was no one there to accept the delivery?  Another call to FedEx – and another wrinkle.  While FedEx could guarantee delivery by noon to Canadian customs, it could not guarantee deli very beyond that.  “They could stay a day or two at customs; it just depends,” the FedEx rep told me.  This didn’t seem like a good idea – we could be stuck in Canada waiting for passports to clear customs.  (An aside – I once waited a long time for a shipment to clear customs in France and learned that there actually is a French verb, dédouaner, which means “to get something out of customs” – when a language has an entire verb dedicated to this, you know you’re in trouble…)

We finally decided to just try to rely on a color copy of the passport, which our neighbors emailed to us.  Perhaps the customs agents would be able to use the numerous identifying numbers on the color copy – as well as photos of us – to allow us to cross.

That settled, we drove out to Vancouver airport for our 40 minute flight to Tofino, on the west coast of Vancouver Island.  Thus began the next challenge for this weekend.

Tofino is often socked in, something that neither the Wick nor the airline told us when we booked this several months ago.  “So what happens if we can’t land,” we asked.  “We’ll get you to Nainamo, on the east coast of Vancouver Island, and drive you across – about 2.5 to 3 hours.”  My wife, who is easily motion sick, turned pale at this – first a bumpy flight in a small turboprop plane, then a nearly three-hour drive across the island?  Let’s hope we can land.  We took off from Vancouver Airport about 12:30 PM, and though the flight was a bit bumpy, we were close to Tofino about 1 PM.  One of the charming things about these small aircraft is there are no secrets – you can see all the instruments and out the pilot’s windowpane.  I watched as the altimeter descended from nearly 8,000 feet through 4,000 to about 2,500 – and then started rising again.  I also watched the “Distance to Destination” readout change from less than a mile to 70.5 miles – clearly we weren’t landing in Tofino.  “The weather’s really deteriorated in Tofino,” the co-pilot turned around to tell us.  “We’re going to try Nainamo, but it doesn’t look good there either – if we can’t do that, we’ll go to Victoria – it’s beautiful in Victoria.”  Victoria – by my reckoning, a good five hour drive from our hotel in Tofino.  Things got bumpier as we flew towards Nainamo, and my wife took full advantage of the airsickness bags provided.  Happy Birthday!  We finally landed in Victoria about 2:45 – over two hours after leaving Vancouver.  There was no way we were going to get in a car for another five hour ride up to Tofino – in addition to wondering what might happen in two days, when we would return.

So with the help of our friends, Steve and Jody, we called around to hotels in Victoria and found a beautiful inn – Brentwood Bay Lodge.  They offered us a “day of” discount on two rooms with water view.  So we settled in for a relaxing evening and Sunday there; highly recommended place, we'll definitely be back.

But how to get back from Victoria?  We could ferry from Victoria to Vancouver, but our car was parked at the Vancouver Airport – not at the ferry terminal, 20 miles away.  We’d need another taxi back to the airport.  We got on the phone to Orca Airways, the carrier, and convinced them to change our return flight to come from Victoria – where they dropped us – rather than Tofino, where we were supposed to be.  It was quite nice this morning when we arrived at the small private aviation terminal at Victoria Airport – parked our rental car right out front, walked in and there was the plane sitting right outside.  No check-in; no security; no hassles.  Looking longingly at the Citation II parked next to our turboprop, I thought, “this is the way to fly.”  Fifteen bumpy minutes later, we were in Vancouver, loading our car – one hour after having departed our Victoria hotel.  Wow!

Oh – and the passports?  When we arrived at the border, we handed over the color copies our neighbors had emailed, along with a driver’s license.  The very friendly US border agent gave us no problem – we got the traditional “Welcome Home!”

Posted by MikeKelly | 2 Comments
Filed under:

HP LaserJet printer hung "processing job"

Vista makes it very easy to add a network printer.  A friend bought an HP laptop and wanted it set up on her LAN to print to a HP LaserJet 5N printer attached to her desktop.  So I went into Visa's 'Add Printer' wizard on the laptop and it discovered the shared printer on the LAN, installed it and said it was installing the driver by querying the printer.  So far, so good.  But printing always caused the LaserJet to hang with a "Processing Job" message displayed on its LED screen.  Only a power cycle on the printer would clear this. 

 I tried visiting the HP site, and found this page http://www.hp.com/cpso-support-new/SDD/main.htm?cc=us&lang=en which claims to install an ActiveX control that will detect whether the correct driver is installed.  I suspected a driver problem, so that seemed just the ticket.  It installed and claimed the wrong driver was installed and that it fixed it.  I rebooted, reprinted - and no cigar - still "Processing Job". 

I thought maybe the HP site hadn't installed the right driver after all.  Going back to the HP site, and searching manually for the Vista driver for the (discontinued) LaserJet 5N, I found a page that claimed the correct driver ships with Vista and there is no download available.  Hmm...

I went to the Printers control panel, right clicked on the printer and selected "Properties" from the "Adminisrator" submenu in the context menu.  This showed me that in fact the HP LaserJet 6N driver was installed - not the 5N.  Ah ha!  So I clicked the "New Driver" button, navigated the control that came up with printer manufacturers listed on the left and model on the right - found the "LaserJet 5N" driver and installed that.  Rebooted.  And it worked! 

So the advice - don't believe either HP or Vista if they claim to have found and installed the correct driver.  It's like the old journalistic saw: "If your mother says she loves you - check it out."  The devil is (usually) in the details - in this case, the difference between a 5N and a 6N.  :)

 

Posted by MikeKelly | 2 Comments
Filed under:

Lost Vista Password

My son has an HP laptop and playing around, changed his password and then couldn't get into his account.  There were a number of problems here, any of which we could have fixed had we been paying more attention earlier on (like soon after he got his laptop):

  1. We could have created a password recovery disk (which can also be on a USB keyfob) - but we didn't.
  2. We could have created a secondary administrative account on the machine with a password known only to me, his dad - but we didn't.

We've now done both of these things since we were able to restore access to the machine under his previous password.  But it was a bit of a trick to get access under the previous password.  I figured we were going to have to reinstall Vista, using the File and Settings transfer program to first grab his old settings and files, and then reinstall all the programs - probably a 3-4 hour undertaking.  But then I had another thought.

The key here was using Vista's System Restore feature. The exact steps will probably vary on your machine (and this is from my memory on his HP laptop, having just done this) but roughly what we did was:

  1. Harangue him for a few hours to try to remember his password, try different variations (with and without caps lock on, for instance) and try omitting characters he might have thought he typed when he changed the password but didn't.  That didn't work. :)
  2. Reboot the machine and press F11 while it's booting - on HP machines, this gets into the "recovery console" which is thoughfully put on the system disk in a separate partition by HP.
  3. Select to restore the system (note: not restore to it's original factory condition - that will reformat your main partition and wipe out your files, which we really wanted to avoid).
  4. Chose to reset to an early restore point - in his case, there was a restore point just four days old.  Vista creates these restore points regularly.  The only thing he had done in the last four days was reset his password, so I thought there was a chance that Vista might reset the old password along with the restore point.  I wasn't sure it would, but I thought it was worth a try.
  5. It took about ten minutes for Vista to do this and it then rebooted - and he was thrilled that he was able to log in with his old password!

I've used System Restore in other cases to get rid of really wierd behavior, and it always works like a charm. This is yet another use.

Oh, yeah, and we then created a secondary administrative account on the machine.  Do that right now if you have a laptop with just one admin account - then squirrel away the password somewhere safe at home and you'll thank yourself one day.

 

Posted by MikeKelly | 10 Comments
Filed under:

Windows C++ Exception Handling

Good post on how to see the stack when an exception is thrown on Windows at http://blogs.msdn.com/slavao/archive/2005/01/30/363428.aspx
Posted by MikeKelly | 1 Comments
Filed under:

Update on Windows XP Install over Windows Server 2003

I wrote about most of the issues I encountered with installing Windows XP on a machine that previously had Windows Server 2003 on it (as part of Windows Small Business Server) in the previous post.  But there was one more wrinkle I thought I would call out since others may run into this.

The XP install ran fine and at some point near the end, it rebooted - I think at this point most of the setup was done and it was "starting Windows for the first time..." as it says.  But on reboot, I got a blank screen.  I waited for 5, 10, 15 minutes - and it became clear that that screen was going to be black forever.  So I did what the clinically insane do - tried again.  Redid Windows XP setup (I was watching a football game during this, so it's not like I was sitting there the whole time and it only takes about thirty minutes...)  And of course, the same thing happened - black screen after reboot. 

At this point -  you'd think I'd learn to do this earlier, wouldn't you? - I stopped to think about what might be happening and I remembered that this machine had both a built-in video controller (on board - Intel Graphics blah blah blah) and a separate video card that I'd installed.  Unplugged video cable from the onboard video to the separate card - et voila, as they say.  Windows had on its own decided to use the other video card, even though it used the onboard video during setup. Go figure.  Thought I'd write this up in case this happens to you - if you have multiple video out ports, make sure Windows isn't talking to one you didn't think it was before giving up and pulling out your hair.

Posted by MikeKelly | 3 Comments

REGISTRY_ERROR blue screen error while installing Windows XP

I have an old Dell Dimension 2350 sitting around and when I learned that the head of our kids' school, West Sound Academy, didn't have a computer at home, I offered to give her this one.  She was thrilled.  I had used the computer as an experimental box - the latest thing I had on it was Windows Small Business Server 2003, which I thought she wouldn't appreciate, so I figured I'd just reinstall the original XP that came with it from Dell, put an old version of Office on it (I had bought non-upgrade versions of Office 2007 for all my home machines, so the old 2003 is now available for use on this machine - that wouldn't be the case, by the way, if I had bought an upgrade version of Office 2007, and, working for Microsoft, I try to be diligent about obeying licensing terms) and give it to her.

 So I booted up the machine and used the old F12 trick to boot to CD.   I didn't notice at first that this Dimension had two drives on it - a DVD drive and CD - this was made before they typically combined those in a single drive - and so it took me a couple of tries to realize that, duh, I had the CD in the DVD drive and so the BIOS wasn't able to boot because it was looking at the (empty) CD drive.  FIxed that and booted up.  Got through XP setup, accepted the license agreement, and then setup said "Looking for previous versions of Windows..." and promptly blue screened with a REGISTRY_ERROR STOP code.

I tried it again and - a result perhaps of one definition of insanity, repeating the same actions and expecting a different result - and didn't get a different result - I got the same bluescreen.

At that point, I stopped to think a bit and realized what was probably happening.  In general, new software installs over older software just fine - during testing, developers test that case and things like the version numbers of newer components work correctly to overwrite older components of the same name.  But installing older software on a system with a newer version generally doesn't work too well.  For one thing, it probably hasn't been tested - how would it?  When the older version was released, the newer version was just a glint in someone's eye - if that.  So Windows Small Business Server 2003 is newer than Windows XP - and Windows Small Business Server 2003 was what I had installed.  Probably whatever detection logic Windows XP setup was running to look for "previous versions of Windows" was freaking out at the newer version of Windows it found.  In fact, looked at this way, the STOP code made total sense - Windows Server 2003 probably changed the registry format in a way that Windows XP setup couldn't understand and so it was crashing when it found what it thought was a Windows registry file - but it couldn't read it.

It's at this point that my bootable PQDI CD became helpful.  What I needed to do was remove any trace of Windows Small Business Server 2003 from this machine, and to do that I needed to reformat the partition with it installed.  PQDI lets me do that.  I don't think you can get PQDI anymore - but there are probably similar tools out there.  Basically, you want to boot to something that lets you delete the partition on the disk that contains the OS.  Doing that will totally hose your computer - it's no longer bootable - except to the CD with the OS installer, which will then come up, see an apparently blank area on the disk and offer to install to it.  It will no longer look for "previous versions" of Windows because there's no where for them to be.  In fact, this is exactly what worked.  XP setup finished like a charm.

There's one more trick.  The XP distributed with this version is of course "RTM", i.e. the original version Microsoft released back in 2001 or so.   XP SP 2 was a major, major improvement in the security of that system.  IN fact, an pre-XP SP 2 system booted with an Internet connection will probably fairly quickly get infected with some virus.  So I was careful to remove the internet connection (I unplugged the cable) prior to installing XP and on another computer (one running Vista - even more secure than XP SP 2) I downloaded the XP SP 2 service pack and burned it to CD, then installed it on the XP machine prior to connecting it to the Internet.  Most of Windows Update (where you get this stuff from) is designed to install on the machine you're running from, but in this case, I worried that even leaving the XP machine connected to the Internet long enough to connect to Windows Update and download the XP SP 2 service pack could result in problems).  So I went to a special download site for "IT professionals" which lets you get the SP 2 as a single file that you can install from CD.

Posted by MikeKelly | 3 Comments

Showing a Checkmark in Excel

I had a problem that was surprisingly not easy to do in Excel, and since it seems like a pretty common thing, I thought I'd provide a note here on how to do this.

Problem: With Excel 2007, you want to display a "checkmark" or a "red x" in a column that has a logical value - i.e. if the value is TRUE then display a checkmark, if it is FALSE then display a red X. 

Excel 2007 has some really nice new conditional formatting options, one of which is "Icon Sets".  This would seem to totally do the trick, but it takes thinking about this problem a bit differently to get it right. 

Icon sets are all based around numeric values, not logical values.  So my mistake was thinking that for what is really boolean data - true or false - I should, well, put TRUE or FALSE in the column.   Nooooooo...  Instead, put a non-zero numerical value (e.g.1, or 10 or 100) in the column if you want to show a checkmark.  Put zero if you want to show a RED X.  Then select the column or cells, go to Conditional Formatting and select Icon Set, then select the set that has the red x, the checkmark, etc.

With the columns or cells still selected, go back to conditional formatting and select "Manage Rules".  You'll see a rule called "Icon Set" in the list.  Select that and click Edit Rule.  Now check the check box "Show Icon Only" - that way you don't see your values, just the checkmark or the red X.

 

 

Posted by MikeKelly | 4 Comments
Filed under:

Visual Studio 2008 "Orcas" Beta 2 and Silverlight

OK, have passed one hurdle in getting Scott Guthrie's Silverlight samples to work with VS 2008 Beta 2.  The trick suggested by Samsp on the Asp.Net forums is to change the version numbers for the assemblies in the web.config to 3.5 from 2.0.  That did the trick and resolved the missing assembly reference error I was getting when running the sample web app:

Parser Error Message: Could not load file or assembly 'System.Web.Extensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

I still have a problem with the samples not seeing Silverlight installed - whenever I run I get the install logo - but I think that has to do with some GUID or version mismatch in the code.

Posted by MikeKelly | 1 Comments
Filed under: ,

Playing with VSTS 2008 Beta 2 and SilverLight 1.1

I've started playing around a bit with Visual Studio Team System Beta 2 release with SilverLight 1.1 Alpha release.  I used Scott Guthrie's SilverLight v1.1 samples.  Haven't gotten this to run yet - I keep running into some sort of configuration error related to System.Web.Extensions.  I'll post back if I get this figured out.

 

Posted by MikeKelly | 1 Comments
Filed under:

Troubleshooting a Local Network

I just spent a few hours on the phone with my friend Mike Loftin diagnosing problems with his local-area network (LAN).  Mike had recently bought a new machine with Vista installed and wanted to get it working wirelessly on his local network at home.  His problem was that it connected to the local network but not the Internet.  After playing around with IPCONFIG and the "Network and Sharing Center" on Vista, we figured out that he wasn't getting the correct DNS information.  He had an old DNS setting for when he used to use Comcast as his ISP - now he's using QWest.  We eventually figured out that Mike had a somewhat screwy configuration of his LAN, for historical reasons.  This probably applies to a lot of people.

What happens is you start with a single computer and a DSL or cable modem, which you connect directly to that machine.  All is good.  Then you get a second machine.  So what do you do?  Typically, you buy a router which enables you to create a local-area network.  Now the "right" thing (or perhaps best thing) to do is isolate the DSL modem from the original computer and plug it directly into the router, then have all the computers (both of them in this case) plug into the router.  However, DSL modems these days are smarter than they probably should be - they sometimes have wireless capability built-in and they have built-in DHCP servers.  When you buy a router with these capabilities as well, you potentially create a problem - you now have two DHCP servers on your network, one from the router and one from the DSL modem.  If you leave the DSLmodem plugged into the original computer and just use internet connection sharing to add the router (which is what Mike did) you have even bigger problems - because the original computer is also acting as a DHCP server (through internet connection sharing). 

So ideally you take a bit of time and do the following:

1. Turn off the DHCP capabilities on the DSL or cable modem - have it just be a simple modem.

2. Plug it into the router.

3. Redo the connections from all LAN computers to the router (whether wired or wireless).  Make sure the router has the DHCP enabled and has the right DNS settings or is set to automatically get the DNS info from the ISP.  Typically, you configure this by opening a browser on a machine connected to the router and type in an address like http://192.168.0.1 (the manual will give you the exact address) which lets you talk to the software on the router to control its configuration.

4. Have all the computers join a common workgroup - you set this in Computer Properties (Start / Computer / right-click and select Properties on Vista) - look down for Computer Name, Workgroup and Domain settings and click "Change Settings".  Two things are important: (a) each computer has a unique name and (b) they all have the same workgroup name (doesn't matter what it is, as long as it is the same). 

5. Reboot everything.

More info at http://www.microsoft.com/windows/products/winfamily/mobility/articles/homenetworking.mspx and http://windowshelp.microsoft.com/Windows/en-US/Help/b27b71d8-4098-47c8-ad95-05f51e49cd121033.mspx.

 

Posted by MikeKelly | 2 Comments

Problem installing "Form Fill" add-in for Windows Live Toolbar

I like the Windows Live Toolbar, but one thing I miss from its predecessor, the Desktop Search Toolbar is auto form fill.  This allows you to capture stuff like your email address, mailing address, etc. in a password-protected file on your local machine and when the toolbar detects a web form, you can with a single button fill in those forms.

I found that with Windows Live Toolbar, you have to install the Form Fill button separately.  But trying to do that from the options dialog consistently failed with an obscure Windows Installer error.

I used to work closely with the Windows Installer team when I was the development manager for Office setup, so I know a bit about debugging failed Windows Installer installs.  The trick is to get a verbose log of the install.

I did this and found this error message in the log:

DEBUG: Error 2738:  Could not access VBScript runtime for custom action
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2738. The arguments are: , ,
MSI (s) (6C:CC) [12:06:01:411]: Product: Form Fill (Windows Live Toolbar) -- The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2738. The arguments are: , ,

Next step: Search the web for the text "Could not access VBScript runtime for custom action".  I found this post which points out that for some reason the VBScript runtime is not registered on Vista (I'm assuming this is probably a security thing to prevent scripts from being easily run). 

Sure enough, registering the VBScript.DLL did the trick and I now have Form Fill!

Posted by MikeKelly | 8 Comments

Adobe Reader 8 and Vista Install Issue

Good post on resolving a problem I also had with installing Adobe Reader 8 on Vista.  There seem to be many symptoms to this problem and the root cause is that Adobe has tried to apparently make the setup too smart and it ends up getting tricked up by something on Vista.  The workaround is to catch the installation files after the self-extracting executable has extracted them, but before it fails to start the install, and copy the files to another directory.  This is because the oh-so-smart Adobe installer deletes the files after it fails to install them.  Copy them to a safe place, then manually run the installation, which will work.  Hopefully Adobe will investigate this problem, which seems it may be related to User Account Control on Vista, and fix it in their installer.

 

Posted by MikeKelly | 19 Comments
Filed under:
More Posts Next page »
 
Page view tracker