人生是一场不能存盘的RPG,我只能尽量多搞几个Screenshot

November 18, 2006

通过脚本修改xp的cd key

Filed under: 使用技巧

http://www.larkmoon.com/read.php/45.htm

ON ERROR RESUME NEXT

Dim VOL_PROD_KEY
if Wscript.arguments.count<1 then
   VOL_PROD_KEY=InputBox("Message1"&vbCr&vbCr&"Message2","The Title","UserInput, key")
   if VOL_PROD_KEY="" then
     Wscript.quit
   end if
else
   VOL_PROD_KEY = Wscript.arguments.Item(0)   ‘Get usr input from command line
end if

VOL_PROD_KEY = Replace(VOL_PROD_KEY,"-","") ‘Remove hyphens if any

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

   result = Obj.SetProductKey (VOL_PROD_KEY)   ’Update key

   if err = 0 then
      Wscript.echo "OK!"
   end if

   if err 0 then
      Wscript.echo "Failed"
      Err.Clear
   end if
Next
 

Comments »

The URI to TrackBack this entry is: http://recordsome.blogsome.com/2006/11/18/p192/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.






















Get free blog up and running in minutes with Blogsome
Theme designed by Hadley Wickham