Just a short, simple blog for Bob to share his thoughts.
06 July 2014 • by Bob • FFMPEG, Video Editing, Scripting, Batch Files
I ran into an interesting situation the other day: I had a bunch of H.264 MP4 files which I had created with Handbrake that I needed to combine, and I didn't want to use my normal video editor (Sony Vegas) to perform the merge. I'm a big fan of FFmpeg, so I figured that there was some way to automate the merge without having to use an editor.
I did some searching around the Internet, and I couldn't find anyone who was doing exactly what I was doing, so I wrote my own batch file that combines some tricks that I have used to automate FFmpeg in the past with some ideas that I found through some video hacking forums. Here is the resulting batch file, which will combine all of the MP4 files in a directory into a single MP4 file named "ffmpeg_merge.mp4", which can be renamed to something else:
@echo off
if exist ffmpeg_merge.mp4 del ffmpeg_merge.mp4
if exist ffmpeg_merge.tmp del ffmpeg_merge.tmp
if exist *.ts del *.ts
for /f "usebackq delims=|" %%a in (`dir /on /b *.mp4`) do (
ffmpeg.exe -i "%%a" -c copy -bsf h264_mp4toannexb -f mpegts "%%a.ts"
)
for /f "usebackq delims=|" %%a in (`dir /b *.ts`) do (
echo file %%a>>ffmpeg_merge.tmp
)
ffmpeg.exe -f concat -i ffmpeg_merge.tmp -c copy -bsf aac_adtstoasc ffmpeg_merge.mp4
if exist ffmpeg_merge.tmp del ffmpeg_merge.tmp
if exist *.ts del *.ts
The merging process in this batch file is performed in two steps:
Here are the URLs for the official documentation on each of the FFmpeg switches and parameters that I used:
By the way, I realize that there may be better ways to do this with FFmpeg, so I am open to suggestions. ;-]
30 June 2014 • by Bob • Configuration, FTP, IIS
I get a lot of question about various configuration settings for the IIS FTP service, and most of the settings that I discuss with people can be configured through the FTP features in the IIS Manager. That being said, there are some useful configuration settings for the FTP service which I periodical send to people that have no user interface for setting them. With that in mind, I thought I would write a quick blog to point out a few of these obscure settings that I personally use the most-often or I send to other people.
I use this setting on all of my FTP servers because it seems a little more natural to me. Here's the scenario: the IIS FTP service supports two kinds of hostnames:
Real FTP hostnames are pretty straight-forward: an FTP client specifies the hostname with a HOST command when a user is connecting to the server. Once the IIS FTP service receives that command, the FTP service routes the FTP session to the correct FTP site.
That being said, the FTP HOST command is still rather new, so only a handful of FTP clients currently support it. Because of that, you can use FTP "virtual" hostnames with the IIS FTP service. By default that syntax uses the "vertical line" or "pipe" character to differentiate between the hostname and user name. For example:
ftp.contoso.com|username
"ftp.fabrikam.com|username
"When you are specifying your FTP credentials in your FTP client, you would enter your username like the preceding examples. While this syntax is valid for both the IIS FTP service and the underlying FTP protocol, it seems a little odd to most users (including me). With that in mind, we added a configuration setting for the FTP service that will allow you to use the more-familiar domain\username syntax like the following examples:
ftp.contoso.com\username
"ftp.fabrikam.com\username
"To enable this feature, use the following steps:
cd /d "%SystemRoot%\System32\Inetsrv"
appcmd.exe set config -section:system.ftpServer/serverRuntime /hostNameSupport.useDomainNameAsHostName:"True" /commit:apphost
net.exe stop FTPSVC
net.exe start FTPSVC
More information about this feature is available in the IIS configuration reference at the following URL:
The FTP service caches user credentials for successfully-authenticated user sessions in order to help improve login performance, and I wrote the following detailed blog about this a couple of years ago:
Credential Caching in FTP 7.0 and FTP 7.5
I don't want to re-post an old blog, but I have sent several people to that blog over the years, so I thought that it was worth mentioning here since it seems to be referenced quite often. The problem that people seem to run into the most is that their old password is still valid for FTP after they have changed it, and this is caused by the FTP service caching their user credentials.
This is especially annoying for me personally when I am working on a development computer where I am creating an authentication provider. Unless I disable credential caching on my development computer, I can never seem to get any work done. To resolve this issue, I disable credential caching for the FTP service by using the following steps:
cd /d "%SystemRoot%\System32\Inetsrv"
appcmd.exe set config -section:system.ftpServer/caching /credentialsCache.enabled:"False" /commit:apphost
net.exe stop FTPSVC
net.exe start FTPSVC
The blog which I mentioned earlier goes into more detail about setting a custom timeout interval for credential caching instead of disabling the feature entirely, and all of the settings for FTP credential caching are in the IIS configuration reference at the following URLs:
FTP Client Certificate Authentication is an often-overlooked feature of the IIS FTP service, and I think that this is due to two reasons:
My second reason cannot be understated; I usually have to set up FTP Client Certificate Authentication once or twice a year in order to test various scenarios, and each time I do so I am reminded of just how difficult it can be to get everything right, and equally how easy it is to get something wrong.
Fortunately I took the time a couple of years ago to write a blog which documents everything that it takes to configure the FTP service, and I have used my notes in that blog several times. In complement to my blog on the subject, Vivek Kumbhar wrote an excellent blog series with additional steps to configure your Active Directory for certificate authentication. With that in mind, here are all of the requisite blog posts that you would need to set up this feature:
As I have mentioned before, configuring this feature is not for the faint-of-heart, but it can be very beneficial from a security standpoint.
For more information about the settings that are required for FTP Client Certificate Authentication, see the following articles in the IIS configuration reference:
That wraps it up for today's post. ;-]
Note: This blog was originally posted at http://blogs.msdn.com/robert_mcmurray/
12 June 2014 • by Bob • Bicycling
I thought that I would take a quick 9-mile ride today in the 100F+ afternoon temperatures just to see what that was like. (Spoiler alert - this was a dumb idea.) My friend Keith had done a similar ride several years earlier on the hottest day in Seattle history, and even though he admitted in hindsight that it probably was a bad plan, sometimes experience is the best teacher - so this is a lesson that I had to learn for myself.
It is a measured 4.5 miles from my doorstep to the guard shack at the Saguaro National Park, which makes it a fairly easy 9-mile ride round-trip on a good day, (with the option of adding an additional 8 miles if you ride through the park itself). There is only 250 feet of elevation change from my house to the park, so I can generally average about 15mph without too much effort.
I use CycloMeter on my Windows Phone to track my rides, and it uses the Windows Phone "Zira" text-to-speech voice to announce each mile that I have travelled, every 10 minutes that I have been riding, and every 100 calories that I have burned.
With that in mind, here is the conversation that ensued between my Windows Phone and me during today's ride:
That's pretty much how the whole ride went down. Just in case you were wondering, the starting and ending temperatures for the ride were both 101 degrees.
Did I mention at any point that this was a dumb idea?
02 June 2014 • by Bob • Guitar, Music
One of my guitar-playing friends recently posted the following article to Facebook as a joke:
http://themindunleashed.org/2014/03/miracle-528-hz-solfeggio-fibonacci-numbers.html
I know that my friend was just being silly, but the actual content of that piece is more drivel in a long line of mathematical silliness which forces me to heave a deep sigh for the fate of humanity. The article in question reinforces my conviction that some people will believe just about anything: bigfoot, aliens, unicorns, Obamacare, leprechauns, etc. But one of my personal favorites is the assertion that altering the base frequency in a tuning scale will somehow lead to a perfect universe.
What a bunch of hooey.
As I mentioned earlier, I know that my friend was posting the article to be silly, but just for the sake of argument, I can't resist taking a look at the math from the article. At the risk of being overly self-indulgent, I know that I have used my A=432Hz Tuning blog post to refute concepts like this in the past. But that being said, my blog post examines a lot of the actual math behind these sorts of silly ideas, and they just don't stand up to scrutiny. Oh sure, there's a bunch of purported facts in the article that my friend posted, (once you get past the gooey new age crap). But as I said earlier, people will believe just about anything.
Here's a case in point: when I visited Machu Picchu I was assured by my tour guide that one of the stones in one of the walls had been certified by NASA as the harmonic center point of all nature. I didn't believe my guide, but in hindsight her statement seems considerably more plausible than anything that was presented in the "Magic 528Hz" article. (Note: I meant that humorously; you can't trust NASA to find the harmonic center point of anything.)
In any event - let's take a look at some of the math from the 528Hz
article, shall we?
If you use A=444Hz
as the article suggests, that does NOT make the frequency for C
fall on an even interval - it's off by a diminutive fraction:
Note | Frequency |
---|---|
A | 444.00 Hz |
Bb | 470.40 Hz |
B | 498.37 Hz |
C | 528.01 Hz |
C# | 559.40 Hz |
D | 592.67 Hz |
Eb | 627.91 Hz |
E | 665.25 Hz |
F | 704.81 Hz |
F# | 746.72 Hz |
G | 791.12 Hz |
G# | 838.16 Hz |
A | 888.00 Hz |
As you can see, the frequency for C
falls pretty close to 528Hz
. But as I mentioned in my blog, what your ear actually wants to hear are frequencies which harmonically-derived perfect intervals across the scale. However, the frequencies in the tuning scale that the article's author is using are based on equal-temperament, which is a harmonically imperfect standard. Because of this fact, you would not use equal-tempered tuning if you were actually trying to calculate harmonically-perfect intervals, so the 528Hz
article is completely busted right there. (On a side note, even frequencies in a full scale like this do not matter to your ear - because they just don't. Period. You can have uneven decimal points for perfect intervals in a harmonically-derived scale if you do your math correctly; arguing about decimal points is just stupid.)
That being said, the author spends a great deal of time rambling on and on about Fibonacci sequences, (which are really cool by the way). However, the author completely fails to mention (or perhaps to even notice) that 528
doesn't fall in the standard Fibonacci sequence:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377,
610, 987, 1597, 2584, 4181, 6765, 10946, etc.
Now, if the number 528
had actually fallen inside the standard Fibonacci sequence, that would have been a pretty cool factoid for the article. But that being said, it still wouldn't mean anything.
Just for the fun of it, let's see how we can manipulate the math a little, shall we?
For example, if you use A=431.33333Hz
as your base frequency, then the frequency for Eb
will be 610.00Hz
, which is actually a valid number in a standard Fibonacci sequence. That's kind of amusing, but it doesn't mean anything useful. All that means is that I spent a lot of time in Excel typing in random base frequencies until I bumped into a number that worked. Likewise, if you use A=443.99Hz
as your base frequency, then your C
will actually be 528Hz
, but that's just as useless. (And good luck trying to find a tuner that will let you use A=443.99Hz
as your base frequency.)
In the end, the article which my friend posted to Facebook is an amusing work of fiction, although reading it will waste several minutes of your life which could have been spent doing something considerably more productive.
30 May 2014 • by Bob • ASP.NET, Azure, IIS
Have you ever wondered how much work is involved when migrating a traditionally-hosted production website to Microsoft Azure? If so, the following case study might be of interest to you:
Microsoft Azure Migration: Microsoft’s .NET Community Websites
Migrating Microsoft’s ASP.NET and IIS.NET Community Websites to Microsoft Azure
Here's a little background information on this migration case study: last fall Microsoft worked with two of it's hosting partners, Neudesic and Orcsweb, to migrate the www.asp.net and www.iis.net websites from a traditional web hosting scenario (e.g. websites hosted on physical servers) to virtual machines that are hosted in the cloud on Microsoft Azure. Here's what the web farm looked like before the migration:
After the migration, Microsoft had reduced both the hosting costs and the number of servers required by almost 50%. Here's what the web farm looked like when the migration had been completed:
There are a lot of people who helped make this migration a success - and there are far too many to name here - but I would like to say a special "thanks" to everyone at Neudesic and Orcsweb for making this migration process as painless as possible.
Note: This blog was originally posted at http://blogs.msdn.com/robert_mcmurray/
28 May 2014 • by Bob • Arizona
I was sitting at the desk in my office when I heard scratching on my window, so I opened my blinds and I saw this guy trying to get in.
For those of you who have never seen one before, this is a Desert Spiny Lizard, and apparently he was confused by the window glass. Based on the fact that the slats in my window blinds are 1.75 inches apart, that places the length of this big guy at somewhere between 10 and 11 inches in size.
I am reminded daily that living in the desert is kind of an adventure...
16 May 2014 • by Bob • Scripting, Visual Studio, Scripting, Visual Studio
I have to download various files from time-to-time, and it's nice when websites provide checksum hashes so I can validate that the file I just downloaded matches the version on the server. (ON a related note, I wrote a blog several years ago which showed how to create a provider for the IIS FTP service which automatically creates checksum files when files are uploaded to a server; see my Automatically Creating Checksum Files for FTP Uploads blog post for the details.)
In order to calculate hashes for files that I have downloaded, several years ago I wrote a simple command-line application for Windows which uses several of the built-in algorithms in .NET's System.Security.Cryptography. And while I realize that there are probably other tools that provide this same functionality, I have used this little utility for years, and I've had several people ask me for copies. With that in mind, I thought that it might make a nice blog topic if I shared the code with everyone. (Note: It's a really simple sample; the .NET framework does all the real work for this application.)
Without further fanfare, here's the source code. In order to use this code sample, you need to create a new C# project in Visual Studio and choose the Console Application template. When the new project opens, replace the template's code with the following:
using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Security.Cryptography; class Hash { static void Main(string[] args) { // Verify the correct number of command-line arguments. if (args.Length != 2) { // Show the help message if an incorrect number of arguments was specified. ShowHelp(); return; } else { byte[] hashValue = null; // Verify that the specified file exists. if (!File.Exists(args[1])) { // Show the help message if a non-existent filename was specified. ShowHelp(); return; } else { try { // Create a fileStream for the file. FileStream fileStream = File.OpenRead(args[1]); // Be sure it's positioned to the beginning of the stream. fileStream.Position = 0; // Use the specified hash algorithm. switch (args[0].ToUpper()) { case "MD5": // Compute the MD5 hash of the fileStream. hashValue = MD5.Create().ComputeHash(fileStream); break; case "SHA1": // Compute the SHA1 hash of the fileStream. hashValue = SHA1.Create().ComputeHash(fileStream); break; case "SHA256": // Compute the SHA256 hash of the fileStream. hashValue = SHA256.Create().ComputeHash(fileStream); break; case "SHA384": // Compute the SHA384 hash of the fileStream. hashValue = SHA384.Create().ComputeHash(fileStream); break; case "SHA512": // Compute the SHA512 hash of the fileStream. hashValue = SHA512.Create().ComputeHash(fileStream); break; case "BASE64": // Compute the BASE64 hash of the fileStream. byte[] binaryData = new Byte[fileStream.Length]; long bytesRead = fileStream.Read(binaryData, 0, (int)fileStream.Length); if (bytesRead != fileStream.Length) { throw new Exception(String.Format("Number of bytes read ({0}) does not match file size ({1}).", bytesRead, fileStream.Length)); } string base64String = System.Convert.ToBase64String(binaryData, 0, binaryData.Length); Console.WriteLine("File: {0}\r\nBASE64 Hash: {1}", fileStream.Name, base64String); hashValue = null; break; default: // Display the help message if an unrecognized hash algorithm was specified. ShowHelp(); return; } if (hashValue != null) { // Write the hash value to the Console. PrintHashData(args[0].ToUpper(), fileStream.Name, hashValue); } // Close the file. fileStream.Close(); } catch (Exception ex) { Console.WriteLine("Error: {0}", ex.Message); } } } } // Display the help message. private static void ShowHelp() {/> Console.WriteLine("HASH.exe <hash algorithm> <file name>\n\n" + "\tWhere <hash algorithm> is one of the following:\n" + "\t\tBASE64\n\t\tMD5\n\t\tSHA1\n\t\tSHA256\n\t\tSHA384\n\t\tSHA512\n"); } // Print the hash data in a readable format. private static void PrintHashData(string algorithm, string fileName, byte[] array) { Console.Write("File: {0}\r\n{1} Hash: ", fileName,algorithm); for (int i = 0; i < array.Length; i++) { Console.Write(String.Format("{0:X2}", array[i])); } Console.WriteLine(); }/>}
When you compile and run the application, you will see following help message when you specify no command-line parameters:
HASH.exe <hash algorithm> <file name> Where <hash algorithm> is one of the following: BASE64 MD5 SHA1 SHA256 SHA384 SHA512
When you specify one of the supported hashing algorithms and a filename, the application will display something like the following example:
C:\>hash.exe SHA1 foobar.zip File: C:\foobar.zip SHA1 Hash: 57686F6120447564652C20426F6220526F636B73
That's all there is to it. As I mentioned earlier, it's a pretty simple sample. ;-]
Note: This blog was originally posted at http://blogs.msdn.com/robert_mcmurray/
13 May 2014 • by Bob • Rants
I have to admit, I love a good conspiracy theory. But I need to explain what I mean by that - I don't actually believe conspiracy theories, but I love to read articles and blogs from people who do. I typically think that most of the people who believe various conspiracy theories are kind of insane, and therefore they are a never-ending source of amusement for me.
This brings me to one of the biggest conspiracy theories that's circulating the planet right now: Global Warming and Climate Change.
I thoroughly love watching the endless debates that inundate the blogosphere about these two subjects. The bulk of the Internet appears fall into one of two ideological camps: there are "Deniers" who think that nothing is happening, and there are "Chicken Littles" who think that the world is coming to an end. (I personally fall into the group of amused spectators who are constantly laughing at everyone else's reactions. And mark my words people - I am not laughing with you, I am laughing at you.)
With that in mind, let's look at some of the actual science. To begin with, the following new article offers up a dire prediction that the Antarctic ice will melt and the oceans will rise as a result:
This should come as a shock to the NASA scientists who were reporting less than two years ago that the Antarctic ice had reached an all-time high:
With conflicting articles like these making their way around the Internet, what's a poor armchair scientist supposed to believe? Fear not, for I bring you undisputed truth: ice melts. That's pretty much it. Your scientific takeaway should be this: unless the sun burns out, we're going to have ice in some places of the planet, and no ice in other places. The ice in some places will eventually melt, and some places where there currently is no ice will eventually get ice. If you've studied the history of this planet, then you already know these facts. If you haven't studied the history of the planet, then be quiet until you do. Period. End of story.
That being said, it is an undeniable fact that the earth is getting warmer. Although it needs to be said that the global temperature is rising from one of the lowest temperatures that has occurred in the past several thousand years. 1,000 years ago the earth was considerably warmer than it is now, but 500 years before that it was cooler than it is now, and 500 years before that it was even warmer than it was 1,000 years ago. That's the way that our planet works: the earth heats up, then it cools, then it heats up again. This has been going on for millions upon millions of years. The questions with which we need to be concerned is how fast the temperature is rising, and what is causing the temperature to rise. Here's where I need to intercede once again: unless you are a scientist who is qualified to analyze these two questions based on the staggering volume of information available and years of professional research experience, then you need to be quiet and let someone who is qualified do their job.
As I mentioned earlier, we can easily see that the earth has gone through several demonstrable heating and cooling periods over the past several millennia. But there is one major difference between those periods and the present: we can now take detailed measurements of the process, and unfortunately the scientific world is filled with scientists who cannot agree on the severity of this new data. But what is far worse is that the media world is filled with reporters with nothing better to do than to create ominous predictions in order to drive traffic to their websites and thereby increase their advertising revenue. So we wind up with a situation where people can throw news articles back and forth all day long saying one thing or other without ever proving a valid point. Here's a perfect example:
As for me, the story gets better, because eventually the conspiracy theorists get involved. There are several theories out there, and they come from all sides. For example, there are some "deniers" who feel that all of this Global Warming stuff is a bunch of malarkey, and their position seemed to be reinforced when it was revealed that a lot of climatologists were faking their data. (It seems that some scientists believed that "The Ends Justify The Means," so they thought that it was acceptable for them to manipulate their data because "The World Will Eventually Thank Them." That may have been a noble cause in their minds, but unfortunately that's bad science.) Then there are the Global Warming proponents who believe that the real impetus behind the deniers is big business and the evil global corporate cabal who would sell their family members if it made a profit. (Unfortunately, there really are some people who are that heinous.) In either case, I love reading the theories from both sides of the argument, because it's not that simple. As a result, their competing theories bring me unending amounts of entertainment.
But at the end of the day, a few categorical facts remain in this debate:
The only constant in all of this turmoil is change. But unfortunately when change is detected within our current ecosphere and subsequently over-represented by the press, opportunistic knee-jerk reactions from bone-headed idiots are the inevitable result. To quote the great philosopher John Osbourne, "The media sells it, and you live the role."
There is one last thought which I want to leave you with: regardless of your views on Global Warming and Climate Change, we only have one planet - so we only have one chance to get things right. If we destroy the planet, then it's gone. Forever. Period. The Boy Scouts teach that you should leave a place in better condition than you found it. That's a good rule to live by, and it's pretty easy to implement in your daily life through simple actions: recycle as much as you can, turn off lights when you leave a room, pick a car with better gas mileage (or ride a bike when possible), etc. Even if it turned out that humanity had no impact on Global Warming or Climate Change, everyone should still do their part to cut down on pollution and make the world a better place; that's just good stewardship.
UPDATE (October, 2015): The following information is a perfect illustration of why climatology articles cannot be taken out-of-context by their title alone:
To summarize the article, NASA's monitoring of Antarctica has revealed that snow accumulation exceeds the loss of ice shelves; however, if you walk away with this single talking point without reading the rest of the article, you are ignoring the fact that NASA fully acknowledges that Antarctica is actually losing ice. So even though the frozen regions of Antarctica are increasing in volume, that does not mean that glaciers in Antarctica have ceased melting.
29 April 2014 • by Bob • Random Thoughts
It seems that I have always had a difficult time explaining to people what I do at Microsoft. It's not that I'm unsure about what I do - the details of my job have always been crystal-clear to me and I love what I am doing. It's just that I can't find a way to explain things in a way that doesn't result in blank stares from anyone who isn't a geek. (This problem isn't limited to me, though; my non-technical wife simply responds "I have no idea what he does" when someone asks her what I do for a living.)
Here's a perfect example: when I was a Program Manager on the Internet Information Services (IIS) team, people would often ask me what I did for Microsoft, and I would reply with something like, "I help design and implement the web publishing protocols for Microsoft's web server."
Other Person: [Blank Stare]
I would attempt to remedy the situation by adding, "You know, I design Microsoft's implementation of Internet technologies like the File Transfer Protocol, WebDAV, and the FrontPage Server Extensions."
Other Person: [Blank Stare]
In a sometimes-futile effort to salvage the conversation from complete disaster, I would interject, "You like to use the Internet, right? Well, your computer is on one side of the Internet, and my team helps build the other side of the Internet. That's kind of what I do."
That comment would usually be met with a slight spark of recognition, which was sometimes followed by a half-muttered, "That's nice."
At one time or other during my tenure as a Program Manager on the IIS team I was responsible for a smattering of disparate technologies; things like FTP, WebDAV, FPSE, FastCGI, PHP, URL Rewrite, IIS Express, Log Parser, etc. Most of those technologies garnered little to no interest for the average person, and many of my coworkers found them pretty boring as well. Just the same, I personally found every one of those technologies completely fascinating. (Why else would I spend eight years trying to get just one new command added to FTP?)
A couple of years ago I left the IIS program management team and I joined the writing team which is responsible for documenting Microsoft's ASP.NET framework; and if you have to ask what that means, then you are probably not interested in the answer.
Still, people would ask me what I do for Microsoft, and I would try to explain my job with statements like, "I document the Application Programming Interfaces (or APIs) for Microsoft's ASP.NET."
Other Person: [Blank Stare]
I would try to nudge the conversation along by saying things like, "I help people write web code."
Other Person: [Blank Stare]
Skipping ahead in the conversation, I would usually make a last-ditch attempt by stating, "Let's say you wanted to create a website; if so, you might read something that I wrote in order to help you get started."
Sometimes this remark would illicit a hint of acknowledgment, but usually I just got another blank stare.
This leads me to a few days ago. My wife and I were at dinner, and a waiter asked me what I did for a living. In the back of my mind I started to say something like, "Well, these days I'm documenting a set of APIs that Java programmers will use with Microsoft Azure technologies [blah blah blah]..."
But what actually came out of my mouth was, "I could explain it to you, but I'm pretty sure you wouldn't want me to. Trust me."
I like that answer. I think I'll stick with it in the future. :-)
11 April 2014 • by Bob • Scripting, Windows
So here's the deal: I don't use anything from Apple. I have no iPod, no iPhone, no Mac, etc. I buy all of my MP3s through Xbox Music and Amazon. :-] Because of this, I have had no real need to install iTunes or QuickTime in years.
But unfortunately it seemed that I had to install either iTunes or QuickTime at one time or other, mainly because some of my digital cameras recorded video in QuickTime *.MOV format. But over the years I learned to detest both iTunes and QuickTime because of the undesirable ways in which they modified my system; both iTunes and QuickTime would remap all of media settings to open in their @#$% player, which I didn't really want in the first place.
Now that Windows supports the *.MOV format natively, and I can easily convert *.MOV files into something infinitely more useful and universal like *.MP4 format, I really never see the need for installing either iTunes or QuickTime.
However, just the other day I installed a new video editor (which shall remain nameless) and it quietly installed QuickTime on my system. I presume that this was to make it easier to import files in *.MOV format into the video editor, but I was pretty upset when I discovered that QuickTime had been installed. What's more, I was angry when I discovered that QuickTime had once again messed up all of my media settings.
In all of this misery is one saving grace: QuickTime has the decency to preserve your original settings. I am assuming that the backups are for when you uninstall QuickTime and attempt to reclaim your system from being hijacked by Apple, but just the same - that little nicety allowed me to fix my system with a little bit of scripting.
So without further introduction - first the script, and then the explanation:
Const HKEY_CLASSES_ROOT = &H80000000 Const strQuickTimeBAK = "QuickTime.bak" Set objRegistry = GetObject("winmgmts:" & _ "{impersonationLevel=impersonate}" & _ "!\\.\root\default:StdRegProv") objRegistry.EnumKey HKEY_CLASSES_ROOT, "", arrSubKeys For Each objSubkey in arrSubKeys If Len(objSubkey)>2 Then If Left(objSubkey,1)="." Then objRegistry.EnumValues HKEY_CLASSES_ROOT, _ objSubkey, arrEntryNames, arrValueTypes If IsArray(arrEntryNames) Then For i = 0 To UBound(arrEntryNames) If StrComp(arrEntryNames(i), strQuickTimeBAK, vbTextCompare)=0 Then intReturnValue = objRegistry.GetStringValue( _ HKEY_CLASSES_ROOT, objSubkey, strQuickTimeBAK, strEntryValue) If intReturnValue = 0 Then intReturnValue = objRegistry.SetStringValue( _ HKEY_CLASSES_ROOT, objSubkey, "", strEntryValue) End If End If Next End If End If End If Next
Here's what this script does: first the script enumerates all of the keys under HKEY_CLASSES_ROOT and looks for file extension mappings, then it looks for mappings which have been modified and backed up by QuickTime. When it locates file extensions which have been modified, it copies the value which was backed up into the default location where it belongs.
All-in-all, it's a pretty straight-forward script, but it sucks that I had to write it.