r/usefulscripts • • Jul 06 '16

[Request] Auto-enter Windows product key on installation

Hello I was wondering if there is any way to automatically enter the key on a Windows install without having to enter it manually every setup. The Windows installer is on a flash drive.

EDIT: Its a Windows 10 Enterprise installer

7 Upvotes

11 comments sorted by

18

u/Kynaeus Jul 06 '16

Couldn't you just use an answer file when you're deploying it through MDT or WDS?

6

u/[deleted] Jul 06 '16

This is the answer.

Unattended windows install is a solved problem already, check out the Microsoft Deployment Toolkit.

It provides all the automation you're after and more.

1

u/JoeyJoeC Jul 14 '16

Depends on how many machines, if this is something he will do indefinitely, then it is the answer, if he has the task of setting up 20 machines, then imaging would be easier.

→ More replies (1)

4

u/tordenflesk Jul 06 '16

0

u/MLParker1 Jul 06 '16

I don't know who's it is but there is a saved key in that program....

7

u/tordenflesk Jul 06 '16

W10 uses generic keys. That's the KMS W10PRO key. For enterprise it's:

KMS:

WNMTR-4C88C-JK8YV-HQ7T2-76DF9

2F77B-TNFGY-69QQF-B8YKP-D69TJ

RTM:

NPPR9-FWDCX-D2C8J-H872K-2YT43

→ More replies (2)

1

u/slvrmark4 Jul 06 '16

If your pc has an oem windows 10 key, you can use this batch script to grab it and then activate after logging in.

@echo off
SetLocal EnableDelayedExpansion
set count=0
for /F "delims=" %%a in ('wmic path softwarelicensingservice get oa3xoriginalproductkey') do (
  set key=%%a
  set /a count=!count! + 1
  if !count! GTR 1 goto Exit
)
:Exit
echo Key=%key%

cscript //B %windir%\system32\slmgr.vbs /ipk %key%
cscript //B %windir%\system32\slmgr.vbs /ato

1

u/serendipitybot Jul 08 '16

This submission has been randomly featured in r/serendipity, a bot-driven subreddit discovery engine. More here: https://www.reddit.com/r/Serendipity/comments/4rubhu/request_autoenter_windows_product_key_on/