Friday, March 12, 2010

An easy way to enable and disable the second monitor in Windows 7

Both Screen Resolution (desk.cpl) part of Windows 7 Control Panel and NVIDIA Control Panel offer a way to enable and disable a secondary monitor. However, they're annoying. It takes too many clicks, and there is a confirmation prompt which cannot be disabled. There is 3rd party software for this, but installing software for this seems excessive, and paying for it seems ridiculous. The OS and/or display adapter drivers should make this easy.

Fortunately, there is an easy solution. It appears under "Connect to a Projector" in the start menu and corresponds to "%windir%\system32\displayswitch.exe". It can also be started using the Windows+P hotkey. Best of all, it allows command line switches, which can be mapped to hotkeys via a utility like HoeKey:

Extend desktop across both displays:displayswitch /extend
Only use primary display:displayswitch /internal
Display same image on both:displayswitch /clone
Only use secondary display:displayswitch /external

Wednesday, March 10, 2010

Verified by Visa sucks

Last night I learned about another shortcoming of the Verified by Visa program. A single authentication allows the merchant to complete multiple transactions, including past transactions which were stopped by Verified by Visa.

I had forgotten one aspect of my Verified by Visa password, and so I was unable to complete a Newegg.ca order. I didn't get any confirmation and the order wasn't listed under the list of orders, and so I assumed the order was aborted. Then I reset my password and repeated the order. After I completed the Verified by Visa authentication, the old order appeared in the list of orders and proceeded as if I had authorized it. In fact, the single Verified by Visa authentication allowed four orders to proceed; each order had been split into two parts by Newegg.

This is not security. A Verified by Visa authentication does not prove consent for anything.

(Yeah, I was able to quickly contact a Newegg customer service representative and void the order. So, everything is ok. The only consequence is decreased confidence in Newegg's website and Verified by Visa.)

Monday, March 01, 2010

Notes on creating an OEM XP disc for an old IBM IntelliStation

  • The computer had all the required files in C:\I386. There was also the VALUEADD folder from the XP CD.
  • C:\I386\UNATTEND.TXT contained the key needed for an OEM pre-activated (SLP) install. That's a better choice than the key on the sticker on the back, because activation not needed. Microsoft provides instructions for preserving OEM pre-activation; basically, just use that key.
  • I verified the files in C:\I386 by comparing MD5 sums with files on an XP CD. There were a few differences, but nothing suspicious. Slipstreamed hotfixes could be identified by searching for the file and its version. There was only one minor error in the files: I386\WIN9XMIG\MAPI\DLL\MKNTFRMCACHE.EXE had been renamed to MKNTFR~1.EXE.
  • SP3 can be slipstreamed onto the initial release (RTM) of XP without obvious errors, but some files won't be updated. Because of this, I first slipstreamed SP2 and then SP3. Because of widely reported problems with slipstreaming SP3 in Vista, I slipstreamed it in XP.
  • Drivers were available in C:\IBMTOOLS\DRIVERS and C:\DRIVERS. The newest drivers were available from IBM's web site, so I used those.
  • I stripped down the UNATTEND.TXT file to create WINNT.SIF file which partly automated the installation. (When installing from a CD, the file must be called WINNT.SIF.)
  • I was able to load mass storage drivers from a floppy. Setup was then able to see the hard drive. However, when copying files to the hard drive, I got a "setup cannot copy the file" error. Eventually I found that the drivers need to be present in A:\$OEM$\TEXTMODE. I wonder if this was because of WINNT.SIF options or it being OEM XP.
  • There are instructions on editing TXTSETUP.SIF to add mass storage drivers to the CD. A better way is to use WINNT.SIF and place the drivers in both \$OEM$\TEXTMODE and \I386\$OEM$\ on the CD.

Changing Windows 7 ICS IP

When Internet Connection Sharing (ICS) is enabled in Windows 7, the local IP address of the computer becomes 192.168.0.1. However, that address isn't locked. I was able to change it to 192.168.1.1 in the usual way (in "Internet Protocol Version 4" properties in the "Local Area Connection" properties.) After this change, DHCP doesn't work right, but NAT works perfectly. So, ICS can be used as an emergency replacement for a router when all the computers have statically assigned IP addresses.

Missing .htc files cause a 404 for the whole page

Last night I was helping a friend fix a web page in Internet Explorer 8.0. The problem was quite weird. The page would load and display properly for a moment, but then Internet Explorer would display its "The webpage cannot be found" page.

We found that this behaviour could be stopped by disabling "Binary and script behaviors" in the ActiveX section of security settings, or by disabling "friendly" HTTP error messages (in advanced settings).

The JavaScript debugger could be used by pausing execution and then reloading the page, but this was not helpful. The location where the 404 appeared changed a bit, and in any case, JavaScript didn't seem to do anything to cause a redirect. JavaScript debugging ended up just being a waste of time.

We eventually found that the problem was due to a missing .htc (HTML Components) file.