"Office 2010 Retail/Volume Project to bypass activation without KMS/keygen?"

Discussion in 'Microsoft Office' started by timesurfer, Sep 19, 2010.

  1. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #181 CODYQX4, Sep 24, 2010
    Last edited: Apr 15, 2019
    .
     
  2. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #182 CODYQX4, Sep 24, 2010
    Last edited: Apr 15, 2019
    .
     
  3. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #183 timesurfer, Sep 24, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Edit: Yea works

    Ok so I clean installed office and installed and it worked then uninstalled then installed then worked again then just kept running the OR4.bat and it kept on working so I want to add script prior to back up in install script that will check if task is installed GOTO MAINMENU with msg to uninstall first before install is attempted else install OR4. So that's what needs doing if anyone want's to before I do...lol Maybe that will stop my error otherwise it looks like it's working. And I advice a clean install of office.

    So what is the code to work with this to keep from overwriting install:

    Code:
    schtasks /query | FINDSTR /I "Rearm2"
    IF ERRORLEVEL 1 echo Rearm2 Task is not yet Installed
    echo. Press any key to return to the main menu.
    pause > nul
    GOTO MAINMENU
    What ERRORLEVEL is it when the task is installed so I can simply

    IF task is installed then msg to uninstall first and GOTO MAINMENU

    ELSE it continues to install as normal
     
  4. unknownzd

    unknownzd MDL Member

    Jul 28, 2008
    130
    19
    10
    #184 unknownzd, Sep 24, 2010
    Last edited: Sep 24, 2010
    That could because of the client machine ID has been reset / changed after reinstalling OS

    From a new MSDN article ...... actually it did show some info about the CMID and the relationship of it for the rearm process.

    From the MSDN article :

    Rearm the Office 2010 installation
    There is a 25-day grace period from the time of installation of KMS clients before notifications to activate are displayed to the user. If you want to deploy an image, you must rearm your Office 2010 installation before you capture the image. If you do not rearm, users see notification dialog boxes at the time that the image is deployed, instead of 25-days after deployment. The 25-day grace period gives ample time for a KMS host to be found and activation to succeed. If activation is successful, users do not see notifications to activate.

    Rearming is important for these reasons:

    - The grace timer is reset to 30 days of grace.

    - The grace timer is frozen.

    - The client machine ID (CMID) is reset.

    - The KMS host uses the CMID to determine the number of unique clients.

    To check the CMID, use the command ospp.vbs /dcmid.

    Rearm is also recommended for MAK deployment. If you are deploying Office 2010 that is configured for MAK activation, and you do not remotely activate for end-users through VAMT 2.0 or ospp.vbs, users see an activation dialog box the first time that an Office 2010 application starts. The activation dialog box is slightly different 25 days after installation. Also, users might immediately see a red title bar if Office 2010 was not rearmed before image capture.

    To rearm your Office 2010 installation
    Make sure all Office 2010 applications are closed.

    Open an elevated command prompt.

    Go to %installdir%\%Program Files%\Common Files\Microsoft Shared\OfficeSoftwareProtectionPlatform. If you installed the 32-bit edition of Office 2010 on a 64-bit operating system, %Program Files% is the Program Files (x86) folder.

    Run ospprearm.exe. If you see a message that states success, you are ready for image capture.

    Important:
    Do not open an Office application, ospp.vbs, or anything related to Office 2010. Doing so starts the grace timer.
    Capture the image or save the VM. For more information about how to capture the image, see Configure Office 2010 for a hard disk image.
     
  5. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    Any help with my error check unknownzd :biggrin:...lol
     
  6. unknownzd

    unknownzd MDL Member

    Jul 28, 2008
    130
    19
    10
    Yea gonna working on it ..... will take some time as I need to backup my MAK key and then change it to KMS client key
     
  7. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #187 timesurfer, Sep 24, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Thanks I've been googling my brain out but can't get it to determine task is not installed hence install. I just want to stop install and give msg if it is installed. Then I think I have working model

    Code:
    @echo off
    @color 9A 
    title OfficeRearm4
    :MAINMENU
    mode con: cols=64 lines=11
    CLS
    echo. 
    echo.
    echo.                   OfficeRearm4 by timesurfer
    echo.      
    echo.       An alternative Office 2010 Rearm Concept Solution     
    echo.
    echo.        A. Install OR4
    echo.        B. Uninstall OR4
    echo.       C. OR4 Status
    echo.                       D. Exit
    echo.   
    
    :CHOOSEACTION
    set /p userinp=    ^   Make your selection: 
    set userinp=%userinp:~0,1%
    if /i "%userinp%"=="A" goto InstallOR4
    if /i "%userinp%"=="B" goto UninstallOR4
    if /i "%userinp%"=="C" goto OR4Status
    if /i "%userinp%"=="D" goto Exit
    echo.
    echo. Try Again...
    echo.
    GOTO CHOOSEACTION
    
    :InstallOR4
    CLS
    mode con: cols=64 lines=21
    title OfficeRearm4
    REM Here will sit logic to determine task is installed or not which determines if OR4 is installed which determines whether or not to install via msg and prompt to return to mainmenu. Could also determine whether OR4 folder is in c:\
    mkdir "%SystemDrive%\OR4"
    net stop osppsvc
    xcopy /cheriky "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" "C:\OR4"
    reg save "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" C:\OR4\Backup.hiv /y
    net start osppsvc
    SET file=%SystemDrive%\OR4\OR4.bat
    IF EXIST %file% attrib -h %file% 
    echo @echo off >%file%
    echo net stop osppsvc >>%file%
    echo xcopy /cheriky "C:\OR4" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" >>%file%
    echo REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f >>%file%
    echo REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f >>%file%
    echo reg restore "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" C:\OR4\Backup.hiv >>%file%
    echo IF Exist "%COMMONPROGRAMFILES%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" ( >>%file%
    echo "%COMMONPROGRAMFILES%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" >>%file%
    echo ) ELSE ( "%COMMONPROGRAMFILES(X86)%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" >>%file%
    echo ) >>%file%
    echo net start osppsvc >>%file%
    "C:\Program Files\Common Files\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.EXE"
    schtasks /create /tn "Rearm2" /tr %file% /sc daily /mo 30 /RL HIGHEST /f
    echo.
    cscript "%PROGRAMFILES%\Microsoft Office\OFFICE14\OSPP.VBS" /dstatus
    schtasks /query | FINDSTR /I "Rearm2"
    IF ERRORLEVEL 1 echo Rearm2 Task is not yet Installed
    echo. Press any key to return to the main menu.
    pause > nul
    GOTO MAINMENU
    )
    
    :UninstallOR4
    CLS
    mode con: cols=64 lines=10
    title OfficeRearm4
    SET file=%SystemDrive%\OR4
    IF EXIST %file% attrib -h %file%
    RD /S /Q  %file%
    schtasks /delete /tn "Rearm2" /f
    echo. Press any key to return to the main menu.
    pause > nul
    GOTO MAINMENU
    )
    
    :OR4Status
    mode con: cols=64 lines=21
    title OfficeRearm4
    cscript "%PROGRAMFILES%\Microsoft Office\OFFICE14\OSPP.VBS" /dstatus
    schtasks /query | FINDSTR /I "Rearm2"
    IF ERRORLEVEL 1 echo Rearm2 Task is not yet Installed
    echo. Press any key to return to the main menu.
    pause > nul
    GOTO MAINMENU
    )
    
    :Exit
    
    I am not getting error when running OR4.bat over and over again. I get error when rarely uninstalling then reinstalling. Then cody restore brings me back
     
  8. unknownzd

    unknownzd MDL Member

    Jul 28, 2008
    130
    19
    10
    #188 unknownzd, Sep 24, 2010
    Last edited by a moderator: Apr 20, 2017
    The code should be
    Code:
    schtasks /Query /TN "\Rearm2" 1>nul 2>nul
    IF ERRORLEVEL 1 (
    echo Rearm2 task has not been installed!
    ) ELSE (
    echo Rearm2 task has already been installed!
    echo Going back to main menu now. Press any key to continue.
    PAUSE 1>nul
    GOTO MAINMENU
    )
    
     
  9. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #189 timesurfer, Sep 24, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Thanks but it's still installing when it's installed

    Ok Thank you
     
  10. unknownzd

    unknownzd MDL Member

    Jul 28, 2008
    130
    19
    10
    #190 unknownzd, Sep 24, 2010
    Last edited by a moderator: Apr 20, 2017
    Sorry the code has been updated ...... please refer to the newer codes please ........ I am sure it is working ..... sry for the typo in my old script

    that was because I haven't read the manual of the IF switch correctly ........ it said the ERRORLEVEL IF switch is actually comparing whether the value is *greater then* or equal to the value ...... and hence ..... when %ERRORLEVEL% is equal to 1, it still passes the IF switch as it is larger then 0

    So is there anything left that is not yet finished?

    The new code is
    Code:
    schtasks /Query /TN "\Rearm2" 1>nul 2>nul
    IF ERRORLEVEL 1 (
    echo Rearm2 task has not been installed!
    ) ELSE (
    echo Rearm2 task has already been installed!
    echo Going back to main menu now. Press any key to continue.
    PAUSE 1>nul
    GOTO MAINMENU
    )
    
     
  11. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,775
    150
    #191 CODYQX4, Sep 24, 2010
    Last edited: Apr 15, 2019
    .
     
  12. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #192 timesurfer, Sep 24, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
  13. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
  14. Bosh

    Bosh MDL Developer

    May 30, 2010
    613
    297
    30
    And what's exactly the error your talking about?? (Sorry but I read the post several times and didn't get it)
     
  15. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
  16. Bosh

    Bosh MDL Developer

    May 30, 2010
    613
    297
    30
    Well, in the toolkit we had problems deleting files because sometimes we killed the process but (and that's my guess, I really don't what it is) I think there was not enough time for the OS to release the resources of the process, so I added a wait of 100 milisecconds and the error was gone.

    I'm not saying it's the same but sometimes unknown errors might happen, and trying heuristical things (like the wait of 100 ms.) might help in this case :)
     
  17. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #197 timesurfer, Sep 24, 2010
    Last edited: Sep 24, 2010
    (OP)
    Dude that might be it? Do you know how to add that can you advice?

    Also I edited my last post a little for you to read

    Edit: Yea it's when the rearm fails. Not sure why. The console gives you little time to see but I think that's what happens. So I need help with a check if fails then retry until succeeds otherwise maybe the restore has something to do with it hopefullly not as that is a bigger problem I believe

    See you guys later off to work
     
  18. unknownzd

    unknownzd MDL Member

    Jul 28, 2008
    130
    19
    10
    Uh if you are good @ Win32 API, you can always check whether the process is already closed or not
     
  19. Bosh

    Bosh MDL Developer

    May 30, 2010
    613
    297
    30
    Yes I know, I use the .Net framework to do that, with the Wait (Thread.Sleep(100); ) until the System.Diagnostics.Process.HasExited property is true. But I don't know how to do that in batch code :p