Insert oemslpkey

Discussion in 'Windows 7' started by tcntad, Apr 17, 2010.

  1. tcntad

    tcntad MDL Guru

    Oct 26, 2009
    4,487
    1,505
    150
    #1 tcntad, Apr 17, 2010
    Last edited by a moderator: Apr 20, 2017
    Insert oemslpkey & now OEM info!

    Hey guys, im working on a small script here to insert certificate and oemslp key.

    The small problem i have now is the selection of oemslp key.

    Code looks like this:
    Code:
    Echo Insert productkey
    Echo What productkey to integrate?
    Echo Windows 7 Keys:
    Echo 1. Starter: 
    Echo 2. Home Basic: 
    Echo 3. Home Premium: 
    Echo 4. Professional: 
    Echo 5. Ultimate: 
    Set /p productkey=
    
    The dism command looks like this:
    Code:
    "%WAIK%\Tools\%cpu%\Servicing\dism.exe" /Image:"%work%\mount" /Set-ProductKey:"%productkey%"
    
    Now i want the option to just press 1-5 and it'll take whatever the key might be and insert it...
    but using "set /p edition=productkey" does not work unfortunately, obviously im doing something wrong:p but what could that be ?

    When using "set /p productkey=" copying and pasting the key works fine but "edition=productkey" not at all.

    Thanks for help :)
     
  2. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,256
    674
    60
    #2 MasterDisaster, Apr 17, 2010
    Last edited by a moderator: Apr 20, 2017
    Try this
    Code:
    Echo Insert productkey
    Echo What productkey to integrate?
    Echo Windows 7 Keys:
    Echo 1. Starter: 
    Echo 2. Home Basic: 
    Echo 3. Home Premium: 
    Echo 4. Professional: 
    Echo 5. Ultimate: 
    choice /c 12345 /N /M "Select Edition? "
    Set edition=%ERRORLEVEL%
    echo Enter the Product Key
    Set /p productkey=
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. tcntad

    tcntad MDL Guru

    Oct 26, 2009
    4,487
    1,505
    150
    #3 tcntad, Apr 17, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
  4. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,256
    674
    60
    I thought you wanted the edition number
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. tcntad

    tcntad MDL Guru

    Oct 26, 2009
    4,487
    1,505
    150
    Sorry no :/

    I first chosed edition /index

    then what i want to do with it and picked integrate oemslpkey

    then it asks for what key to integrate and im given the 5 choices above and then its suppose to integrate key..
     
  6. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,256
    674
    60
    #6 MasterDisaster, Apr 17, 2010
    Last edited by a moderator: Apr 20, 2017
    It is a bit shabby but will get the work done

    Code:
    Echo Insert productkey
    Echo What productkey to integrate?
    Echo Windows 7 Keys:
    Echo 1. Starter: 
    Echo 2. Home Basic: 
    Echo 3. Home Premium: 
    Echo 4. Professional: 
    Echo 5. Ultimate: 
    choice /c 12345 /N /M "Select Edition? "
    IF ERRORLEVEL 5 SET edition=Ultimate: & goto input
    IF ERRORLEVEL 4 SET edition=Professional: & goto input
    IF ERRORLEVEL 3 SET edition=Home Premium: & goto input
    IF ERRORLEVEL 2 SET edition=Home Basic: & goto input
    IF ERRORLEVEL 1 SET edition=Starter: & goto input
    :input
    set /p productkey=
    set key=%edition% %productkey%
    echo %key%
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. tcntad

    tcntad MDL Guru

    Oct 26, 2009
    4,487
    1,505
    150
    #7 tcntad, Apr 17, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
  8. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,256
    674
    60
    You don't need the EditionID while integrating key using DISM.
    Your initial script is correct and will integrate the key properly.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. tcntad

    tcntad MDL Guru

    Oct 26, 2009
    4,487
    1,505
    150
    #9 tcntad, Apr 17, 2010
    Last edited: Apr 17, 2010
    (OP)
    Hm.. i am confused lol..
    your script tells me to enter editionid (1-5) and if i pick lets say 3 it goes to input which tells me then to enter the key, is that right ?

    Edit: Its not much of a big dael but itd be nice just to have to press "1. starter" and it'll take the starter key..
     
  10. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,256
    674
    60
    #10 MasterDisaster, Apr 17, 2010
    Last edited by a moderator: Apr 20, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. tcntad

    tcntad MDL Guru

    Oct 26, 2009
    4,487
    1,505
    150
    Exactly:)....

    Man this is confusing..
     
  12. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,256
    674
    60
    Do you want the user to enter the product key?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,256
    674
    60
    Then the code snippet on post #10 will be sufficient.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. tcntad

    tcntad MDL Guru

    Oct 26, 2009
    4,487
    1,505
    150
    #16 tcntad, Apr 17, 2010
    Last edited: Apr 17, 2010
    (OP)
    Thumbs up. ill try it right away :)
    Code works fine but the key didnt so ill check it out :p

    hm... i know that the 5th editionit IS ultimate..
    Error: 87

    The specified product key could not be validated.
    Verify that the specified product key is valid and that it matches the target edition.
     
  15. tcntad

    tcntad MDL Guru

    Oct 26, 2009
    4,487
    1,505
    150
    Hm nope, doesnt work. error 87 :/
     
  16. Phazor

    Phazor MDL Expert

    Sep 1, 2009
    1,144
    518
    60
    #18 Phazor, Apr 17, 2010
    Last edited by a moderator: Apr 20, 2017
    Are you using this line exactly as it is written below?

    Code:
    "%WAIK%\Tools\%cpu%\Servicing\dism.exe" /Image:"%work%\mount" /Set-ProductKey:"%productkey%"
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. tcntad

    tcntad MDL Guru

    Oct 26, 2009
    4,487
    1,505
    150
    #19 tcntad, Apr 17, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Ofcourse i am :)

    It works fine when i paste and copy the product key but not when using masterdisasters code above.
     
  18. Phazor

    Phazor MDL Expert

    Sep 1, 2009
    1,144
    518
    60
    OK, excuse my confusion then, but what did you do before that?

    Did you actually extract all 5 images from the wim?

    Because normally you would mount one image, inject the key, commit, then mount the next image, inject, commit, and so on.

    But you dont seem to be mounting any images with that command, on the contrary, it looks as though you are trying to inject the key(s) into unmounted images.

    Or am i just missing something?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...