# little windows activation file for ya



## Solaris17 (Jun 21, 2013)

I have a decent job now for all those wondering were I have been. and in the course of my current career I have to manage deploying large amounts of PCs. since some of the images are old on our deployment server for specific models I wrote a little script to speed up the process of activating windows on them. I figure someone in my type of situation may find this useful. All you have to do as the user is

A run it as admin

B get the key off the sticker on the side of the PC

This batch will delete itself after it is done. since it needs to be run as admin to pass the SLMGR commands I image it inside the /public/desktop folder so that any tech logging into the PC no matter what the account can see and use it. and since techs are the first to boot the machine it makes sense to put it in /public/desktop so that 

A its availible to w/e tech needs it and

B when it completes no one else can use it especially those pesky end users.


```
@ECHO off
color 71
title Windows key change utility
cls
Echo.
Echo This utility will activate imaged machines using pre-existing
Echo OEM keys Please have them on hand.
Echo.
Echo To successfully run this utility please make sure it is running as Admin.
ECHO.
Pause
ECHO Now removing current product key...
timeout /t 5 >NUL
ECHO.
SLMGR -UPK
ECHO Done!
ECHO.
ECHO Now removing current product key from the registry...
timeout /t 5 >NUL
ECHO.
SLMGR -CPKY
ECHO Done!
ECHO.
ECHO Please turn caps lock on and enter the windows key below including dashes '-'
ECHO then press enter. Example:: 101TH-15K3y-15NtR-3al11
ECHO.
ECHO Please DOUBLE CHECK! You will only have -ONE- shot at this!
Echo.
set/p input=""
ECHO.
ECHO Got It! Inserting key into Registry this can take a minute...
Echo.
SLMGR -IPK %input%
Echo Key successfully inserted!
Echo.
Echo Authenticating...
timeout /t 5 >NUL
SLMGR -ATO
Echo.
Echo Seems legit...
Echo.
timeout /t 5 >NUL
ECHO If activation was successful please close the window and restart the machine.
Echo.
Echo If activation was NOT successful please try again or refer to your 
ECHO Deployment Administration guide.
Echo.
Echo This bat will now self destruct and the system will be rebooted.
PAUSE
shutdown -r -t 3 >NUL
DEL "%~f0"
```


----------



## Solaris17 (Jun 21, 2013)

although if anyone knows a way to silence the SLMGR prompts after a successful pass and still manage to let them complete im all ears.

At first i accidentally posted the test script I was working on which included cscript like so

cscript //b slmgr -XXX

however passed like this while silent and the batch continued windows never activated. I think it got hung up on

cscript //b slmgr -IPK %input%

or

cscript //b SLMGR -ATO

though I cant be sure. I didnt test to see if the key was actually inserted.


----------



## Mindweaver (Jun 21, 2013)

Good job Solaris17! I like it! I wrote one similar to yours awhile back, but I like yours.  People say batch files are to old, but I still use ones that I wrote years ago.. lol They are simple and gets the job done.


----------



## Solaris17 (Jun 21, 2013)

Mindweaver said:


> Good job Solaris17! I like it! I wrote one similar to yours awhile back, but I like yours.  People say batch files are to old, but I still use ones that I wrote years ago.. lol They are simple and gets the job done.



thanks man appreciate it  w/e it takes right? besides programs require .net and a bunch of other crap.

Also congrats on mod whenever that happened iv been gone a few months


----------



## Mindweaver (Jun 21, 2013)

Solaris17 said:


> Also congrats on mod whenever that happened iv been gone a few months



Thanks buddy!  

Also, I miss Windows 2000, and no activation. I remember years ago at a company I was with I was ghosting 5 boxes across the network... and it was a 10/100 and in most parts it was only 10mb at most.. lol I brought the network to a screeching halt.. lol I had about 150 people calling me and paging me... After that I created a small network just for ghosting rigs.. hehehe


----------



## Solaris17 (Jun 21, 2013)

Mindweaver said:


> Thanks buddy!
> 
> Also, I miss Windows 2000, and no activation. I remember years ago at a company I was with I was ghosting 5 boxes across the network... and it was a 10/100 and in most parts it was only 10mb at most.. lol I brought the network to a screeching halt.. lol I had about 150 people calling me and paging me... After that I created a small network just for ghosting rigs.. hehehe



thats what i did!!!! had to make an internal network for the distro server because the honda employee switches would freak out. woops


----------

