Vous devez être membre et vous identifier pour publier un article.
Les visiteurs peuvent toutefois commenter chaque article par une réponse.

Modifier la clé de Windows XP

Astuces de l’Infobrol (Windows Xp)Article publié le 30/10/2005 07:03:36


Sur le site de Microsoft, on trouve la manière de modifier sois-même la clé entrée lors de l'installation de Windows XP:

changevlkeysp1.vbs
  1. '
  2. ' WMI Script - ChangeVLKey.vbs
  3. '
  4. ' This script changes the product key on the computer
  5. '
  6. '***************************************************************************
  7.  
  8. ON ERROR RESUME NEXT
  9.  
  10.  
  11. if Wscript.arguments.count‹1 then
  12. Wscript.echo "Script can't run without VolumeProductKey argument"
  13. Wscript.echo "Correct usage: Cscript ChangeVLKey.vbs ABCDE-FGHIJ-KLMNO-PRSTU-WYQZX"
  14. Wscript.quit
  15. end if
  16.  
  17. Dim VOL_PROD_KEY
  18. VOL_PROD_KEY = Wscript.arguments.Item(0)
  19. VOL_PROD_KEY = Replace(VOL_PROD_KEY,"-","") 'remove hyphens if any
  20.  
  21. for each Obj in GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("win32_WindowsProductActivation")
  22.  
  23. result = Obj.SetProductKey (VOL_PROD_KEY)
  24.  
  25. if err ‹› 0 then
  26. WScript.Echo Err.Description, "0x" & Hex(Err.Number)
  27. Err.Clear
  28. end if
  29.  
  30. Next

On lance le script de cette manière:

c:\changevlkeysp1.vbs ab123-123ab-ab123-123ab-ab123



NB:
c:\changevlkeysp1.vbs représente le chemin vers le script
ab123-123ab-ab123-123ab-ab123 représente la nouvelle clé

  1. '
  2. ' WMI Script - ChangeVLKey.vbs
  3. '
  4. ' This script changes the product key on the computer
  5. '
  6. '***************************************************************************
  7.  
  8. ON ERROR RESUME NEXT
  9.  
  10. if Wscript.arguments.count‹1 then
  11. Wscript.echo "Script can't run without VolumeProductKey argument"
  12. Wscript.echo "Correct usage: Cscript ChangeVLKey.vbs ABCDE-FGHIJ-KLMNO-PRSTU-WYQZX"
  13. Wscript.quit
  14. end if
  15.  
  16. Dim VOL_PROD_KEY
  17. VOL_PROD_KEY = Wscript.arguments.Item(0)
  18. VOL_PROD_KEY = Replace(VOL_PROD_KEY,"-","") 'remove hyphens if any
  19. Dim WshShell
  20. Set WshShell = WScript.CreateObject("WScript.Shell")
  21. WshShell.RegDelete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WPAEvents\OOBETimer" 'delete OOBETimer registry value
  22. for each Obj in GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("win32_WindowsProductActivation")
  23.  
  24. result = Obj.SetProductKey (VOL_PROD_KEY)
  25.  
  26. if err ‹› 0 then
  27. WScript.Echo Err.Description, "0x" & Hex(Err.Number)
  28. Err.Clear
  29. end if
  30.  
  31. Next



Avatar :: nohope Un article de nohope

Source : www.microsoft.com


Sélection, tri et recherche d'articles
FILTRER :
TRIER :1er critère : 2e critère :
CHERCHER : Dans les titres Dans le contenu


[Afficher les liens en fonction des critères du formulaire ci-dessus]

Document créé le 13/09/2004, dernière modification le 26/10/2018
Source du document imprimé : https://www.gaudry.be/ast-rf-252.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.