Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

All permutations of a Windows license key

I need to apply for a Windows 8 upgrade for my laptop, for which I need the Windows 7 license key on the underside of the laptop.

Because Microsoft decided in their infinite wisdom to create license labels that wear off, and I cannot read my license key clearly, it means I can't register my laptop for the windows upgrade offer using an automated process.

By holding the laptop at an angle to the light I have been able to verify most of the code but several of the letters are ambiguous (thanks again Microsoft for using easy to misread characters in your label).

I have the following (obfuscated) license key,

MPP6R-09RXG-2H[8B]MT-[B8]K[HN]M9-V[6G]C8R 

where the characters in square brackets are ambiguous, so it is either 8 or B, B or 8, H or N, 6 or G.

Making 16 combinations.

Is it appropriate to generate the possible permutations of this license key using itertools or is there a better way?

I got the correct key with thanks to the contributors. A very convenient way to check if the key is valid is by using the Windows 7 product key checker.

like image 752
Kerridge0 Avatar asked Jan 30 '13 14:01

Kerridge0


People also ask

How do I find my Windows license key?

Generally, if you bought a physical copy of Windows, the product key should be on a label or card inside the box that Windows came in. If Windows came preinstalled on your PC, the product key should appear on a sticker on your device. If you've lost or can't find the product key, contact the manufacturer.

Where can I find my Windows product key without the box?

Right-click the Start Menu button and then select Windows PowerShell (Admin) from the context menu. Type this command at the prompt to reveal the product key as shown in Figure B.

Can you use your Windows 10 license key code more than once?

No, the key which can be used with either 32 or 64 bit Windows 10 is only intended for use with 1 of the disk.

Can you use license key on multiple computers?

If it's a retail Full or Upgrade license - yes. You can move it to a different computer as long as it's only installed on one computer at a time (and if it's a Windows 7 Upgrade version the new computer must have it's own qualifying XP/Vista license).


1 Answers

Disclaimer: Yes, I know that this is not Python code. It just popped into my mind and I simply had to write it down.

The simplest way is the use of shell expansion:

$ echo MPP6R-09RXG-2H{8,B}MT-{B,8}K{H,N}M9-V{6,G}C8R MPP6R-09RXG-2H8MT-BKHM9-V6C8R MPP6R-09RXG-2H8MT-BKHM9-VGC8R MPP6R-09RXG-2H8MT-BKNM9-V6C8R MPP6R-09RXG-2H8MT-BKNM9-VGC8R MPP6R-09RXG-2H8MT-8KHM9-V6C8R MPP6R-09RXG-2H8MT-8KHM9-VGC8R MPP6R-09RXG-2H8MT-8KNM9-V6C8R MPP6R-09RXG-2H8MT-8KNM9-VGC8R MPP6R-09RXG-2HBMT-BKHM9-V6C8R MPP6R-09RXG-2HBMT-BKHM9-VGC8R MPP6R-09RXG-2HBMT-BKNM9-V6C8R MPP6R-09RXG-2HBMT-BKNM9-VGC8R MPP6R-09RXG-2HBMT-8KHM9-V6C8R MPP6R-09RXG-2HBMT-8KHM9-VGC8R MPP6R-09RXG-2HBMT-8KNM9-V6C8R MPP6R-09RXG-2HBMT-8KNM9-VGC8R 
like image 86
bikeshedder Avatar answered Oct 08 '22 13:10

bikeshedder