예전에 BDD 했을 때 사용한 VB Script 인데, 혹시 몰라 올려 놓습니다.
지금은 대세가 Windows 7인지라...


'
' WMI Script - ChangeVLKey.vbs
'
' This script changes the product key on the computer
'
'***************************************************************************

ON ERROR RESUME NEXT


if Wscript.arguments.count<1 then
   Wscript.echo "Script can't run without VolumeProductKey argument"
   Wscript.echo "Correct usage: Cscript ChangeVLKey.vbs ABCDE-FGHIJ-KLMNO-PRSTU-WYQZX"
   Wscript.quit
end if

Dim VOL_PROD_KEY
VOL_PROD_KEY = Wscript.arguments.Item(0)
VOL_PROD_KEY = Replace(VOL_PROD_KEY,"-","") 'remove hyphens if any

for each Obj in GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("win32_WindowsProductActivation")

   result = Obj.SetProductKey (VOL_PROD_KEY)

   if err <> 0 then
      WScript.Echo Err.Description, "0x" & Hex(Err.Number)
      Err.Clear
   end if

Next
Wscript.echo "Windows XP의 제품 키 변경이 완료되었습니다."

 원리는 간단합니다 WMI을 돌면서 win32_WindowsProductActivation 에 대한 인터페이스를 가져온 뒤, 그 안에 입력받은 볼륨키를 넣어주는 기능입니다.
사용방법은 위의 Script를 실행할 때, 파라미터로 볼륨키를 넣어주시면 됩니다.  

       Cscript ChangeVLKey.vbs  ABCDE-FGHIJ-KLMNO-PRSTU-WYQZX

그 중 이텔릭체로 된 부분은 위의 스크립트를 저장한 파일이름인데, 그 파일이름으로 하시면 됩니다.


728x90

+ Recent posts