Author: devonenote

  • Exceed Windows Server 2008 R2 Trial Period

    Windows Server 2008 R2 does not ask for a CD key in setup, and it can be run for 30 days for free before needing to be active. You can continue to use it after 30 days trial but the system will reboot every 2 hours and run with reduced functionalities.

    If you want to evaluate or run testing on a server with Windows Server 2008 R2 installed. The following procedures will walk you through the steps to extend your grace period.

    Re-arm windows

    Type in the following from an elevated command prompt:

    slmgr.vbs –rearm

    This will reset the activation expiration and the machine is good for another 30 days. You can do this up to 3 times and get 120 days free trial in total.

    (more…)

  • Remove Earlier Version of Windows boot option

    After I upgrade from Windows XP to Windows 7, I see two options at boot up, one is to logon to Earlier Version of Windows, the other is Windows 7. The default option is boot into Windows 7.

    There is a workaround to remove the Earlier Version of Windows option from the boot up screen so that it will boot straight into Windows 7 instead of asking users to choose which OS or waiting for 30 seconds and boot into Windows 7.

    (more…)

  • SpellChecker in WPF4 TextBox

    TextBox and RichTextBox in WPF4 has the built in SpellChecker functionality. It’s currently available in following four languages

    • #LID 1033 – English
    • #LID 3082 – Spanish
    • #LID 1031 – German
    • #LID 1036 – French

    Enable SpellChecker functionality on TextBox or RichTextBox is as easy as just setting SpellCheck.IsEnabled to True on the controls.

       <TextBox SpellCheck.IsEnabled="True" />

    (more…)

  • Limitations you need know before installing Hpyer-V on laptop

    If you are thinking about installing Hyper-V on laptop, you need to put following into consideration. Some of Hyper-V’s design will limit laptop’s functions, these limitation are reasonable for a server operation system but would be a pain when you consider installing Hyper-V on a laptop.

    You cannot connect a virtual network to a wireless network adapter

    As a result, you cannot provide wireless networking capabilities to virtual machines. if you mainly use wireless NIC or all communication between the VM and the outside world would have to be through the Wireless NIC, this will turn out to be a great deal.

    Power-saving features are disabled after Hyper-V role is enabled

    (more…)

  • How to Install Hyper-V

    What is Hyper-V

    Hyper-V is Microsoft’s supported form of machine virtualization.  It allows you to run any number of guest machines on your host machine.  Each guest thinks it’s running on its own hardware, and is unaware that it’s just a simulation.

    Hyper-V also provides an easy way to snapshot and rollback virtual machine to an old saved stage.

    Hyper Installation Prerequisites

    • Operation System – Hyper-V is only available in 64 bit versions of Windows Server 2008 and Windows Server 2008 R2
    • Hardware – Processors should include a virtualization option. For example, Intel Virtualization Technology (Intel VT) or AMD Virtualization (AMD-V).

    If you are not sure if your computer processor supports hardware virtualization, you can checkout Microsoft’s Hardware-Assisted Virtualization Detection Tool. The tool also checks if virtualization is enabled on the processor.

    (more…)

  • CopySourceAsHtml for Visual Studio 2010

    CopySourceAsHtml is an add-in for Microsoft Visual Studio 2008 that allows you be able to quickly get your code as HTML from Visual Studio, just like being able to save it as a HTML file from the Save As dialog. It’s very helpful if you frequently post code to blog or send code in email.

    I recently switched to Visual Studio 2010 and noticed this plug in is not ready for Visual Studio 2010 yet. Here is how you can get it work for Visual Studio before CopySourceAsHtml owner releases an official update to support Visual Studio 2010.

    (more…)

  • Use coalescing operator to write more readable code

    Tired of code like this?

    public string Foo

    {

    get { return foo; }

    set

    {

    if (value == null)

    value = String.Empty;

    foo = value;

    }

    }

    public string Bar

    {

    get { return bar; }

    set

    {

    if (value == null)

    value = String.Empty;

    bar = value;

    }

    }

    Use coalescing operator to make your code a bit more readable.

    (more…)

  • Access denied when creating a folder just deleted

    I have a batch script which remove a folder and re-create it. The command that remove a folder is rd /s/q and the command create folder is mkdir. Recently I see something weird happening, everytime when the folder is deleted and re-created, there is error message Access is denied displayed. However, if I rerun the create folder command laer, it always pass successfully.

    The explanation on http://support.microsoft.com/?id=159199 seems make sense,

    This file is in a state known as pending deletion. This file has been deleted, but there are still handles open to it. NTFS will wait until all handles to this file are closed before updating the index. If an attempt is made to access the file, however, NTFS will deny the attempt. Because the file is listed in the index, but is effectively deleted, you can see the file but you cannot access it.

    The workaround here is add a 60 seconds sleep between the folder deletion and folder creation operation.

  • WordPress Keyword Description

    In most of WordPress themes, there is not meta description and meta keywords handle. This result every page of site has a empty description and keyword in page header, which is not good from search engine’s perspective.

    This can be workaround by installing plug All in One SEO. But for those who concern plugin will slow down their sites, here is a simple hack, all needs to do here is just adding a few lines in header.php.

    Firstly open header.php, find this line <meta http-equiv=”content-type” content=”text/html; charset=<?php bloginfo(‘charset’); ?>” />

    (more…)

  • Windows could not connect to the System Event Notification Service

    If you see Windows could not connect to the System Event Notification Service error on VISTA, Windows server 2008, or Windows 7, you can try follow these steps to get it resolved.

    1. Click Start, click All Programs, and then click Accessories.
    2. Right-click on the Command Prompt and then select Run as Administrator.
    3. Once the Command Prompt has opened, type following command and then press ENTER.

      netsh winsock reset

    4. Close the Command Prompt and restart the machine.