msgbartop
Computer says no
msgbarbottom

15 Feb 10 Opera 10.5 Beta and Windows 7 Integration

Opera 10.5 Beta is out and it’s very impressive, and looks pretty stunning due to its Windows 7 integration.

One thing I don’t really like is how it shows all the tabs using Aero Peek when you click it in the Task Bar.

You can turn this off:

  1. Type “opera:config” in the address bar and hit Enter
  2. Scroll down to User Prefs and expand it, or type in “Windows 7″ in the search box
  3. Untick the “Use Windows 7 Taskbar Thumbnails” setting
  4. Click Save
  5. Restart Opera

Tags: , , ,

02 Dec 09 Running 32-bit Remote Desktop Connection on Windows 64 bit

On Windows Vista 64 and Windows 7 64, there is a 32 bit version of Remote Desktop Connection (Microsoft Terminal Services Client, mstsc.exe) in %SystemRoot%\SysWOW64.

Running this mstsc.exe will launch the 32 bit process but it will instantly launch the 64-bit mstsc.exe from System32 and shut itself down. This makes it impossible to run Remote Desktop Connection 32 bit.

This is a problem when you have 32 bit Terminal Services add-ins (which won’t run under 64 bit).

Solution: Rename the 64-bit mstsc.exe from System32 to prevent it from replacing the 32-bit process.

This is simple if you have rights to rename that file. If you’re on NTFS you may get a “You require permission from TrustedInstaller to make changes to this file” error.

To get by this error, you can take Ownership of the file and give yourself full permissions:

  1. Browse to %SystemRoot%\System32
  2. Right click mstsc.exe and choose Properties
  3. Go to the Security tab
  4. Click Advanced
  5. Go to the Owner tab
  6. Click Edit
  7. From the “Change owner to:” list, choose your user name
  8. Click OK
  9. Go to the Permissions tab
  10. Click Change Permissions…
  11. Click Add
  12. Enter your user name and click OK
  13. Tick the box in the Allow column for Full control
  14. Click OK
  15. Click OK
  16. A Windows Security warning will come up; click Yes to proceed
  17. Click OK

Now, you can rename the file mstsc.exe to something like mstsc.exe.bak

Then, you can launch mstsc.exe from %SystemRoot%\SysWOW64 and you will have 32-bit Remote Desktop Connection running.

Tags: , , , , , , , , , , , , ,

23 Nov 09 Free Anti-Virus: Microsoft Security Essentials

Microsoft Security Essentials is a free anti-virus program.

All of the free anti-virus programs out there have usually pretty quickly fallen out of favour with me, in particular the previous community darling AVGFree.

Having a free option from Microsoft, that performs extremely well with minimal resource usage, is a boon.

For privacy reasons, you might want to opt out of the Microsoft SpyNet. Opting out is a very manual process though, with instructions here

Download Microsoft Security Essentials

Tags: , , , , , ,

30 Sep 09 Generating GUIDs from Visual Studio 2008

I find I have to generate GUIDs often (mostly due to using WiX) and the in-built Tools > Create GUID tool is too cumbersome for this.

I found a blog post that has a simple macro you can customize to bind a keyboard shortcut to paste in a new GUID

Here are some full instructions, using their simple macro code:

  1. Tools > Macros > Macro Explorer (or hit ALT+F8)
  2. Right click Macros, choose New Macro Project…
  3. Choose a location for the Macro project and give it a meaningful name then click Add
  4. Rename Module1 to something more meaningful, then double-click to edit the module
  5. Insert the code to paste a new GUID into the current cursor position / selection:

    Public Sub PasteNewGuid()
    DTE.ActiveDocument.Selection.Text = "{" & System.Guid.NewGuid().ToString("D").ToUpper() & "}"
    End Sub
  6. Save the macro project and close the Macro IDE
  7. In Visual Studio: Tools > Options, select Environment > Keyboard
  8. Find the macro command you created (you can use the Show commands containing: to search on guid)
  9. Select the command in the list
  10. Ensure Use new shortcut in: has Global selected
  11. Place the cursor in Press shortcut keys: and hit the shortcut (ALT+G for me)
  12. Hit OK
  13. Test it out

Tags: , , , , , , ,

19 Aug 09 Solution: Explorer open each folder in same window error and SQL Management Studio, IE and Team Explorer errors

Problem(s):

  • When attempting to open a folder in Windows Explorer, the folder opens in a new window, even if “Open each folder in the same window” is selected in Folder Options.
  • Some links in Internet Explorer don’t open correctly
  • Microsoft SQL Server Management Studio: An error with a message like “Unable to cast COM object of type ‘System.__ComObject’ to interface type ‘Microsoft.VisualStudio.OLE.Interop.IServiceProvider’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{6D5140C1-7436-11CE-8034-00AA006009FA}’ failed due to the following error: No such interface supported (Exception from HRESULT: 0×80004002 (E_NOINTERFACE)). (Microsoft.VisualStudio.OLE.Interop)
  • Visual Studio Team Explorer: When browsing using the Team Explorer window, you may get COM errors similar to those in the SQL Management Studio error above

Explanation:

I’m not sure of the exact details, but this is what I think I’ve found. Perhaps someone at Microsoft would correct or elaborate on this.

Previously, actxprxy.dll (ActiveX Interface Marshaling Library) was used as the proxy for a multitude of system interfaces, such as IShellFolder and IServiceProvider.

In Windows 7 (and probably Vista also), the GUID of this library has changed from {B8DA6310-E19B-11D0-933C-00A0C90DCAA9} to {C90250F3-4D7D-4991-9B69-A5C5BC1C2AE6}

Secondly, there is also a new Proxy/Stub provider found in ieproxy.dll of Internet Explorer (IE ActiveX Interface Marshaling Library). Some interfaces that previously used actxprxy.dll are now registered to use ieproxy.dll.

Now various problematic software (such as Vault 3.x) will try to register against actxproxy using the old GUID, and for interfaces now proxied by ieproxy.dll.

Solution

You must use regsvr32 to re-register the two proxy DLLs, then reboot

You can use the below batch file to do this.

You must run this batch file with administrative privileges (right click on the file and choose Run as administrator):

RunAsAdministrator

If you don’t run the batch file as an administrator, you will get an error as pictured:

ActxprxyRegisterError

[Download RegisterActxprxyAndIeproxy.cmd]

RegisterActxprxyAndIeproxy.cmd source:

@echo off

:: 32 bit and 64 bit
IF EXIST "%SystemRoot%\System32\actxprxy.dll" "%SystemRoot%\System32\regsvr32.exe" "%SystemRoot%\System32\actxprxy.dll"
IF EXIST "%ProgramFiles%\Internet Explorer\ieproxy.dll" "%SystemRoot%\System32\regsvr32.exe" "%ProgramFiles%\Internet Explorer\ieproxy.dll"

:: 64 bit only (32bit on 64 bit)
IF EXIST "%WinDir%\SysWOW64\actxprxy.dll" "%WinDir%\SysWOW64\regsvr32.exe" "%WinDir%\SysWOW64\actxprxy.dll"
IF EXIST "%ProgramFiles(x86)%\Internet Explorer\ieproxy.dll" "%WinDir%\SysWOW64\regsvr32.exe" "%ProgramFiles(x86)%\Internet Explorer\ieproxy.dll"

Don’t forget to reboot after re-registering the DLLs!

Edit: The script has been updated to support 64-bit Windows

Tags: , , , , , , , , , , , , ,

19 Aug 09 Using batch parameter modifiers to get specific portions or file info from a full filename

From Using batch parameters [microsoft.com]:

Cmd.exe provides the batch parameter expansion variables %0 through %9. When you use batch parameters in a batch file, %0 is replaced by the batch file name, and %1 through %9 are replaced by the corresponding arguments that you type at the command line

These batch parameter modifiers variable arguments are immensely useful.

That document is missing some examples, so I’ve put together a simple table:

%1

Original argument

“C:\Users\DMoore\Documents\Document Name.txt”

%~1

Expands %1 and removes any surrounding quotation marks (“”).

C:\Users\DMoore\Documents\Document Name.txt

%~f1

Expands %1 to a fully qualified path name.

C:\Users\DMoore\Documents\Document Name.txt

%~d1

Expands %1 to a drive letter.

C:

%~p1

Expands %1 to a path.

\Users\DMoore\Documents\

%~n1

Expands %1 to a file name.

Document Name

%~x1

Expands %1 to a file extension.

.txt

%~s1

Expanded path contains short names only.

C:\Users\DMoore\DOCUME~1\DOCUME~1.TXT

%~a1

Expands %1 to file attributes.

–a——

%~t1

Expands %1 to date and time of file.

19/08/2009 02:53 p.m.

%~z1

Expands %1 to size of file. (bytes)

9

Tags: , , , , , , , , , , , , ,

14 Aug 09 Opera 10 Beta 3 is out

Opera 10 Beta 3 is out! The timing is uncanny because the last time I did a clean install of Windows 7, Beta 2 came out hours after I had done a new install.

Today I installed Windows 7 RTM on my machine at work, and then hours later, a new beta of Opera 10. What the?

[Opera 10 Beta 3 @ opera.com]

Tags: , , , , ,

03 Jun 09 Unit testing multi-threaded, asynchronous code and/or events

I’ve been writing some unit tests recently that test some multi-threaded functionality.

Typically this involves hooking up some event handlers then waiting for some asynchronous code to fire the event before proceeding with the unit test and assertions.

The ManualResetEvent class (MSDN) seems a good choice for this, and this post has a small example of using it in a unit test:


[Test()]
public void AfterRunAsync()
{
    ManualResetEvent manualEvent = new ManualResetEvent(false);

    TestTestCase tc = new TestTestCase(1, "", 0, 0);
    bool eventFired = false;
    tc.RunCompleted +=
        delegate(object sender, AsyncCompletedEventArgs e) {
            Assert.IsInstanceOfType(typeof (TestTestCase), sender, "sender is TestCase");
            bool passed = tc.Passed;
            string output = tc.Output;
            eventFired = true;
            manualEvent.Set();
        };
    tc.RunAsync();
    manualEvent.WaitOne(500, false);
    Assert.IsTrue(eventFired, "RunCompleted fired");
}

Tags: , , , , , , ,

28 May 09 Remote debugging from Visual Studio 2008 on a domain machine to a machine not on the domain

This details how you can debug an application running on a remote machine from Visual Studio on your local machine, as if the remote application was running on your local machine.

The keys are:

  1. There must be a user account with the same username and password on the remote machine and the local machine (MACHINE account, not domain account).
  2. Visual Studio 2008 Remote Debugger must be installed and running on the remote machine under the user account in point 1

Create local machine account

  1. Right click My Computer > Manage
  2. Expand Computer Management > System Tools > Local Users and Groups
  3. Right-click Users under Local Users and Groups and choose New User…
  4. Enter in the username e.g. DebugUser
  5. Enter and confirm the password
  6. Un-check “User must change password at next login” and tick “Password never expire”
  7. Click Create
  8. Click Close

Create remote machine account

  1. Log on to the remote machine and repeat the steps for “Create local machine account”
  2. You must use the same username and password
  3. Find the user in the Users list and double-click to edit them
  4. Go to the Member Of tab
  5. Click Add…
  6. Type in Administrators and hit Enter or click OK
  7. Click OK

Run Visual Studio 2008 Remote Debugger

You have several options for launching the Remote Debugger.

  1. If you install Visual Studio 2008, the Remote Debugger folder can be found in %ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE. In the Remote Debugger folder are separate folders for the x86 and x64 versions. Perhaps the easiest solution is to share this folder over the network, allowing you to launch the debugger over the network without having to install anything on the remote machine.
  2. Alternatively, you can find the Remote Debugger setup on the first disc for the Visual Studio 2008 setup, in a sub folder called Remote Debugger.
  3. Or, you can download it from here

It’s a good idea to run this as a Windows application as recommended by the Visual Studio 2008 Remote Debugger Configuration Wizard (and in my opinion easier to troubleshoot).

At this point if you’re not logged in as the new user you created, you might want to do that now so that you can run the Remote Debugger under them.

Once you’ve followed instructions for installing, run the remote debugger if it isn’t already by going to Start > Programs > Microsoft Visual Studio 2008 > Visual Studio Tools > Visual Studio 2008 Remote Debugger.

It should say that it’s running an instance similar to DebugUser@RemoteMachineName

Connect to the remote machine with Visual Studio

  1. In Visual Studio on your local machine, go to Debug > Attach to process…
  2. Make sure the Transport drop-down at the top is set to Default
  3. In Qualifier, type in the name of the Remote Debugger instance e.g. DebugUser@RemoteMachineName and hit Enter
  4. You should then see the list of remote processes in the list and can select the one you want and click Attach.

Tags: , , , , , , , , , ,

27 May 09 Set up IP filtering in uTorrent and keep your ipfilter.dat up to date easily

The IPFilter Updater application now has its own page: http://www.davidmoore.info/ipfilter-updater/

uTorrent is one of the most popular BitTorrent clients out there. In my opinion it’s the best.

You can set up IP filtering in uTorrent to block bad seeds and peers from a list maintained by the community.

How to set up IP filtering in uTorrent

  1. Open up uTorrent and go to Options > Preferences from the menu or click the Preferences button in the toolbar
  2. Select the Advanced option in the tree
  3. Find ipfilter.enabled in the list and make sure it’s set to true
  4. Click OK

How to get and update the ipfilter.dat

I’ve written a simple program that will download the ipfilter.dat from SourceForge and copy it into the file where uTorrent expects it.

Download uTorrent IPFilter Updater [ Requires .NET 3.5 ]

UPDATED  26 Jan 2010: Now requires .NET 3.5, and allows mirror selection

  1. Extract the files to a folder, and run IPFilter.UI.exe
  2. Wait for it to download the mirrors, select the one you want, and click Go
  3. Once the file has downloaded and extracted, you can close the window

Enhancements

Done:

  • Download and extract zip file to speed up the download time and minimize the download usage
  • Allow selection of mirror you want to use

To Do:

  • Automation through command-line arguments, for scheduled tasks

Source Code: http://github.com/DavidMoore/IP-Filter-Updater/

How to get uTorrent to pick up the new ipfilter.dat

You have two options:

  1. You can simply exit and restart uTorrent to load theIPFilter or
  2. You can leave uTorrent open and reload the IPFilter by selecting the Peers tab, right clicking in the list and choosing Reload IPFilter. Annoyingly you need a selected torrent for this to work.

Looking in the Log should show a message similar to “Loaded ipfilter.dat xxxxxx entries)”

Because IP ranges and addresses change often, it’s a good idea to update your filter list often too.

Tags: , , , , , , ,