Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Tuesday, November 10, 2009

Adventures in Diffing...

So today Schneier recommended AVG as a useful, free anti-virus solution. As I'm terribly anti-virus, I wanted to see if really ran "...in the background, automatically, and you won't notice any performance degradation at all." So I installed it. My first step was going to be comparing the registry before and after the install to see what sorts of things it was installing. This is where my experiment took a left turn: I just wanted to view the diff.

c:\Users\jeff\Desktop>dir *.reg
Volume in drive C has no label.
Volume Serial Number is 96A6-6911

Directory of c:\Users\jeff\Desktop

11/10/2009 09:18 AM 487,799,220 registry-after-install.reg
11/10/2009 08:53 AM 487,588,198 registry-before.reg
2 File(s) 975,387,418 bytes
0 Dir(s) 220,934,803,456 bytes free

Turns out the registry is frickin' huge! Whatever AVG did, it added about 211k of goop to the registry.

My first attempt was to use my favorite diff tool, windiff.exe. Windiff has been my trusted companion ever since I joined MSFT back in 2001. Today, for the first time, it let me down. After churning on the files for about two minutes it ran out of memory.



Very sad.  So, next we tried gnu diff from the command line.  Gnu diff allocated some memory, then allocated some more, and, in a manner much quicker than windiff, proceeded to give me garbage output because it doesn't believe in unicode.



I also tried P4Merge, but it knew its limitations.



In a last-ditch effort to get the info I wanted, I turned to the Mac.  FileMerge on OS X 10.5 (so, the 32bit version) failed as well.  It churned for awhile, the crashed with no clear reason, but I suspect it was out of memory.



So, my little experiment failed.  What did we learn from all this?  The Windows Registry is too large, I think.  Or, just trust Bruce.

Tuesday, December 4, 2007

how to cleanly start and stop explorer.exe

This is a re-posting of a post originally published on 2004-07-22. The original can be found here. This version has been updated to match what is currently reality.

When you are developing Shell Extensions, sometimes you want to be able to cleanly start a new instance of explorer.exe without picking up all the environment variables of whatever command window you've got running (since environment is inherited). Similarly, you may want to shut down explorer.exe cleanly so that it releases its references on your dll--generally so that you can swap in a new version.

Cleanly Starting Explorer

The trick is to hold down CTRL while you select New Task. This will automagically launch an new instance of Explorer.

CTRL+SHIFT+ESC->File->CTRL+New Task (Run...)

Cleanly Shutting Down Explorer on Windows XP

The way to tell Explorer to shut down is to say you want to shutdown the machine, but then cancel in a special way:

Start->Shutdown->CTRL+ALT+SHIFT+Cancel

Cleanly Shutting Down Explorer on Windows Vista

During development of Windows Vista, they changed the way shutdown worked. They got rid of the shutdown dialog and replaced it with better options on the Start menu. Thus the way to cleanly shutdown Explorer had to change. Now you do some magic right on the start menu itself.

Start->CTRL+SHIFT+Right Click [on some empty space]->Exit Explorer

When you CTRL+SHIFT+Right Click on the empty space, a context menu appears with a clearly labeled option for shutting down explorer.exe.