• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. inw
    I
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Best 0
    • Controversial 0
    • Groups 0

    inw

    @inw

    0
    Reputation
    294
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    inw Unfollow Follow

    Latest posts made by inw

    • RE: Windows 7: How to avoid manually activating each machine after deployment.

      [quote=“Steve Dearman, post: 10452, member: 3124”]This is similar to the problem I have 50 oem machines with label keys on top so I created a script to read the serial number from the bios and change the key and activate.

      [CODE]’ Use “wmic bios get serialnumber” to get the serial number if its not documented elsewhere.
      Dim sSerial
      Dim sKey
      set cnn = createobject(“adodb.connection”)
      set rs = createobject(“adodb.recordset”)
      Set objWMIService = GetObject(“winmgmts:” _
      & “{impersonationLevel=impersonate}!\.\root\cimv2”)
      Set colBIOS = objWMIService.ExecQuery _
      (“Select * from Win32_BIOS”)
      For each objBIOS in colBIOS
      sSerial = objBIOS.SerialNumber
      Next
      cnn.open “Provider=Microsoft.Jet.OLEDB.4.0; Data Source=.; Extended Properties=”“text;HDR=Yes;”“”
      rs.open “select * from serials.csv where Serial='” & sSerial & “'”, cnn, 3, 3

      Do until rs.eof
      sKey = rs.fields.item(“key”).value
      rs.MoveNext
      loop
      If Not IsEmpty(sKey) Then
      Dim objShell
      Set objShell = Wscript.CreateObject(“WScript.Shell”)
      objShell.Run "c:\windows\system32\cscript c:\windows\system32\slmgr.vbs /ipk " & sKey,1,TRUE
      objShell.Run “c:\windows\system32\cscript c:\windows\system32\slmgr.vbs /ato”,1,TRUE
      Set objShell = Nothing
      End If

      [/CODE]

      This reads a csv file called serials so its easy to update.

      [CODE]Serial,Key
      HKCF91LC102731,abcde-fghij-klmno-pqrst-uvwxy
      [/CODE]

      I call this from the setupcomplete.cmd as outlined in the main windows 7 fog guide so everything is activated with the correct key right from the word go[/quote]

      Hi Steve,
      Question on your script:

      1. Do you save your script as .cmd or .vbs?
        2.What path do you placed your script and cvs file? ( Is it the same location as setupcomplete.cmd?)
        thanks in advanced
      posted in Windows Problems
      I
      inw