Friday, September 14, 2007

IT Gymnastics

I got into a Visual Basic pain in the dorsal side recently. A painful bug at first sight of which I was gracefully relieved after a quick search on Google. The fix was to run a third party .exe file which applied a patch to the Windows registry. Nothing unconventional about this, except the rather unusual procedure I had to follow which made me laugh my ass off for about 20 minutes. I discovered that double clicking on the .exe file was not enough, I actually had to schedule a Windows shell (cmd.exe) to be executed a few moments later to have it run under the "System" user and not the "Administrator" one. For the geeks, the command line is this :

AT time /INTERACTIVE cmd.exe
The fantastic explanation is the following : "The 'AT' command is required to run the registry patch since it runs the patch using the System account rather than the Administrator account. The System account is sometimes needed to make changes to the registry that cannot be done using the Administrator account".

It's not about bashing Windows, but other operating systems (their name often ends with the letter X) provide a simple and synchronous command which basically does the same thing, you just need to know the superuser password :
su - root
Therefore I bravely scheduled my "cmd.exe" to launch five minutes later in order to do some basic IT tasks like taking a piss an grabbing a coffee.