Blog

Upgrade from Windows 10 Home to Pro

If you bought a computer with preinstalled Windows 10 Home and would like to upgrade to Pro, you have to buy Windows 10 Pro in order to get the Pro product key. In my case buying a full OEM version was cheaper than upgrade. But even having got the product key for the Pro version, you cannot simply upgrade by changing your product key. Even clean install would not help. In the BIOS of your computer there is an OEM Marker. So if the computer originally came with preinstalled Windows 10 Home, exactly that version would be installed even if you perform clean install from the install media of the Pro version. You won’t be even asked for a product key as the one in BIOS would be automatically taken.

So you need to use the following workaround. Upgrade to Pro using the default product key:

VK7JG-NPHTM-C97JM-9MPGT-3V66T

Then change the procuct key to your Pro’s one.

Source: http://answers.microsoft.com/en-us/insider/wiki/insider_wintp-insider_install/how-to-troubleshoot-product-activation-in-windows/33f31475-93b3-4d1c-812f-4b21fbd807a7

Tabifying/Untabifying Multiple Files in Visual Studio

Visual Studio provides the possibility to tabify/untabify selected lines out-of-box (Edit > Advanced > Tabify Selected Lines for tabifying or Edit > Advanced > Untabify Selected Lines for untabifying). That is a nice feature, but it works only on per-file basis. So, how to process multiple files in a solution?

The easiest way is using the standard Find and Replace window: (Edit > Find and Replace > Replace in Files or with keyboard shortcut Ctrl + Shift + H). What we want to do is simply replace tab symbols with desired number of spaces:

Specifying parameters for untabifying in Find and Replace window
Specifying parameters for untabifying in Find and Replace window

Make sure “Use Regular Expressions” box is selected, otherwize the “\t” string will be treated literally, not as the tab symbol.

Pros: free, quick, undoable, reversible (e.g. replacing four spaces with a tab and then a tab with four spaces leaves the file in unaltered state), customizable (e.g. file location and types).

Cons: spaces and tabs from the whole line are affected, not only the ones in the beginning. That means, comments placed on the end of the line may not be nicely aligned after replacement. That should not be a problem if your C# code conforms C# Coding Conventions, which encourage placing comments on separate lines, not at the end of lines of code.

It is still possible to replace symbols only from the beginning of lines by adding a “^” symbol to the regex expression in the Find what box, but in this case replacement will require multiple iterations (one iteration per nesting level).

First iteration:

Specifying parameters for untabifying in Find and Replace window
Specifying parameters for untabifying in Find and Replace window, first iteration

Second iteration (note increased number of spaces in both Find what and Replace with boxes):

Specifying parameters for untabifying in Find and Replace window
Specifying parameters for untabifying in Find and Replace window, second iteration

…and so on.

This method provides better results, but requires a bit more manual work and is more error-prone.

Adding Directory to PATH without Reboot or Logoff/Logon

To add “C:\New Directory” to the Path variable temporarily, i.e. for current cmd session:

set path=%path%;C:\New Directory

To add the same directory to the Path user variable:

setx path "%path%;C:\New Directory"

This command updates the Path value under the HKEY_CURRENT_USER\Environment key in the Registry.

Note the “x” in the name of the command: “setx“, not “set”.

To add the directory to the Path system variable:

setx path "%path%;C:\New Directory" /M

This command updates the Path value under the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment key.

Note the “/M” parameter.

Remove Microsoft Personalized Ads from Skype for Windows

In a few words, the solution is:

  1. Redirect the source of the Ads to your computer by adding the following entries in the hosts file:
    127.0.0.1 m.adnxs.com
    127.0.0.1 ib.adnxs.com
    127.0.0.1 pixel.alephd.com
    127.0.0.1 apps.skype.com
    127.0.0.1 rad.msn.com
  2. Flush DNS by running “ipconfig /flushdns” command.
  3. If the problem comes back repeat the step No. 2.

Wix Standard Bootstrapper Application without License Agreement

In the bundle file replace:

<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />

with:

<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
  <bal:WixStandardBootstrapperApplication 
    xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
    LicenseUrl=""
  />
</BootstrapperApplicationRef>

WixStandardBootstrapperApplication has three variants as explained in the WiX Manual. HyperlinkLicense is the simplest. It has a license link on the welcome page instead of a license page. It allows you to specify an empty URL for the license, in which case it would not display the link.

Links: Stackoverflow, WiX Manual.

Q&A for Remote Desktop

Q: What is key sequence for CTRL+ALT+DEL?
A: CTRL+ALT+END.

Q: How to restart/shutdown remote host?
A: Press CTRL+ALT+END, and then click “Shutdown”. Or, use the shutdown command at a command prompt.