[Solved] How to Install license directly from installed path?

Discussion in 'Scripting' started by xinso, Apr 23, 2014.

  1. xinso

    xinso MDL Guru

    Mar 5, 2009
    4,242
    5,512
    150
    #1 xinso, Apr 23, 2014
    Last edited by a moderator: Apr 20, 2017
    How to make InstallCertCTR behaviours the way as InstallCertRTM without having to copy files to %temp% for it to work?

    Thanks.

    Code:
    :InstallCertRTM
    for %%x in (%~dp0$OEM$\$$\Setup\Scripts\CERT\%edition%\*.xrm-ms) do (%slmgr% /ilc %%x //b)
    goto:eof
    :-----------------------------------------
    :InstallCertCTR
    copy /y "%ProgramFiles%\Microsoft Office 15\root\Licenses\%edition%vl_kms*.xrm-ms" %temp% >nul 2>&1
    for %%x in (%temp%\%edition%vl_kms*.xrm-ms) do (%slmgr% /ilc %%x //b)
    del /f /q %temp%\%edition%vl_kms*.xrm-ms >nul 2>&1
    goto:eof
    (Error: 3002 File could not be opened.(ADODB.Stream))
     
  2. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,773
    1,089
    60
    #2 Mr Jinje, Apr 23, 2014
    Last edited by a moderator: Apr 20, 2017
    Guessing like that.
     
  3. xinso

    xinso MDL Guru

    Mar 5, 2009
    4,242
    5,512
    150
    Mr Jinje.

    I tried, but Error: 3002 File could not be opened.(ADODB.Stream) remains.

    Thanks.
     
  4. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,773
    1,089
    60
    probably spaces in path quotes issue, or I have missed a backslash in the path.
     
  5. xinso

    xinso MDL Guru

    Mar 5, 2009
    4,242
    5,512
    150
    #5 xinso, Apr 23, 2014
    Last edited by a moderator: Apr 20, 2017
    (OP)
    ATM, I managed it this way and it also works:

    Code:
    :InstallCertCTR
    %slmgr% /ilc "%ProgramFiles%\Microsoft Office 15\root\Licenses\%edition%vl_kms_client-ppd.xrm-ms" //b
    %slmgr% /ilc "%ProgramFiles%\Microsoft Office 15\root\Licenses\%edition%vl_kms_client-ul.xrm-ms" //b
    %slmgr% /ilc "%ProgramFiles%\Microsoft Office 15\root\Licenses\%edition%vl_kms_client-ul-oob.xrm-ms" //b
    goto:eof
    Thanks