IORRT - The Official Office 2010 VL Rearm Solution

Discussion in 'MDL Projects and Applications' started by timesurfer, Dec 1, 2010.

Thread Status:
Not open for further replies.
  1. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
  2. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    What is the path to the backup.hiv via explorer?
     
  3. tomah

    tomah MDL Senior Member

    Sep 25, 2010
    408
    355
    10
    It's whatever "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" points to. Unfortunately, I'm not sure what that path is in Win7 but in XP, it is: "C:\Documents and Settings\All Users\Microsoft\OfficeSoftwareProtectionPlatform"

    OR just goto a command prompt and:

    DEL "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform\Backup.hiv"
     
  4. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
  5. tomah

    tomah MDL Senior Member

    Sep 25, 2010
    408
    355
    10
  6. tomah

    tomah MDL Senior Member

    Sep 25, 2010
    408
    355
    10
    @timesurfer

    Just noticed your front page image re: task scheduler has a REARM task in there. Is this new?
     
  7. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    That's for IR4 it has task also

    Now help me I'm confused and I've been working on this way too long today. Where are we...lol

    I still can't delete the hidden hiv file nor find it

    And my code here works but still get that check msg

    Any suggestions?

    Is our only problem just when insalling and the check thing?
     
  8. tomah

    tomah MDL Senior Member

    Sep 25, 2010
    408
    355
    10
    Just so I know where we are, what code are you using and is IORRT installed or uninstalled?
     
  9. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #170 timesurfer, Dec 5, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
    I forgot to put code :eek:...lol

    Code:
    @echo off
    @color 0C
    title IORRT
    
    REM Variables
    set InstallRoot=
    set OfficeArchType=
    
    REM Check Office Architecture Type
    if '%processor_architecture%'=='x86' Set OfficeArchType=32 && Goto:EndArchCheck
    goto:WOWCheck
    
    :WOWCheck
    2>nul REG QUERY HKLM\SOFTWARE\Microsoft\Office\14.0\Common | find /i "InstallRoot" 1>nul
    IF ERRORLEVEL 1 Set OfficeArchType=WOW && Goto:EndArchCheck
    Set OfficeArchType=64
    
    :EndArchCheck
    
    REM Get Office Installed Path
    if %OfficeArchType%==WOW (
    FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Common\InstallRoot" /v Path') DO SET InstallRoot=%%B 
    Goto:FoundPath
    )
    FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Common\InstallRoot" /v Path') DO SET InstallRoot=%%B
    
    :FoundPath
    
    REM Start OSPPSVC (To make sure it is started to prevent strange cases where it doesn't start automatically from failing (XP))
    1>nul 2>nul net start osppsvc
    
    :MAINMENU
    mode con: cols=45 lines=10
    CLS
    echo.
    echo.
    echo.  
    echo.    InfiniteOfficeRestoreRearmTask (IORRT) 
    echo.    
    echo.               A. Install
    echo.               B. Uninstall
    echo.               C. Restore/Rearm
    echo.               D. Status
    echo.               E. Exit
    echo.
      
    :CHOOSEACTION
    set /p userinp=    ^   Make your selection: 
    set userinp=%userinp:~0,1%
    if /i "%userinp%"=="A" goto Install
    if /i "%userinp%"=="B" goto Uninstall
    if /i "%userinp%"=="C" goto Restore/Rearm
    if /i "%userinp%"=="D" goto Status
    if /i "%userinp%"=="E" goto Exit
    echo.Try Again...
    GOTO CHOOSEACTION
    
    :Install
    CLS
    mode con: cols=64 lines=21
    title IORRT
    schtasks /query | FINDSTR /I "IORRT"
    IF ERRORLEVEL 1 (
    echo Installing IORRT
    ) ELSE (
    echo IORRT has already been installed!
    echo.
    echo Press any key to return to the main menu
    PAUSE 1>nul
    GOTO MAINMENU
    )
    mkdir "%SystemDrive%\IORRT"
    net stop osppsvc
    xcopy /cheriky "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" "%SystemDrive%\IORRT"
    reg save "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup.hiv
    net start osppsvc
    SET file=%SystemDrive%\IORRT\IORRT.bat
    IF EXIST %file% attrib -h %file% 
    echo @echo off >%file%
    echo net stop osppsvc >>%file%
    echo xcopy /cheriky "%SystemDrive%\IORRT" "%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" %SystemDrive%\IORRT\Backup.hiv >>%file%
    echo net start osppsvc >>%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 schtasks /delete /tn "IORRT" /f >>%file%
    echo schtasks /create /tn "IORRT" /tr "%SystemDrive%\IORRT\IORRT.bat" /sc daily /mo 1 /ru "" >>%file%
    IF Exist "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" ( 
    "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" 
    ) ELSE ( "%commonprogramfiles(x86)%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" 
    )
    schtasks /create /tn "IORRT" /tr "%SystemDrive%\IORRT\IORRT.bat" /sc daily /mo 1 /ru ""
    echo.
    
    cd /d "%InstallRoot%"
    cscript OSPP.VBS /dstatus
    
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    
    :Uninstall
    mode con: cols=64 lines=21
    title IORRT
    schtasks /query | FINDSTR /I "IORRT"
    IF '%ERRORLEVEL%' EQU '0' (
    echo Uninstalling IORRT
    ) ELSE (
    echo IORRT is already uninstalled
    echo.
    echo Press any key to return to the main menu
    PAUSE 1>nul
    GOTO MAINMENU
    )
    net stop osppsvc
    REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    REG RESTORE "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup.hiv
    DEL "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform\Backup.hiv"
    DEL %SystemDrive%\IORRT\IORRT.BAT
    xcopy /cheriky "%SystemDrive%\IORRT" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform"
    net start osppsvc
    SET file=%SystemDrive%\IORRT
    IF EXIST %file% attrib -h %file%
    RD /S /Q  %file%
    schtasks /delete /tn "IORRT" /f
    cd /d "%InstallRoot%"
    cscript OSPP.VBS /dstatus
    echo.
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    
    :Restore/Rearm
    mode con: cols=64 lines=21
    title IORRT
    schtasks /query | FINDSTR /I "IORRT"
    IF '%ERRORLEVEL%' EQU '0' (
    echo Restoring/Rearming IORRT
    ) ELSE (
    echo Install IORRT before you restore/rearm
    echo.
    echo Press any key to return to the main menu
    PAUSE 1>nul
    GOTO MAINMENU
    )
    net stop osppsvc
    xcopy /cheriky "%SystemDrive%\IORRT" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform"
    REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    reg restore "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup.hiv
    net start osppsvc
    IF Exist "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" ( 
    "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" 
    ) ELSE ( "%commonprogramfiles(x86)%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" 
    )
    schtasks /delete /tn "IORRT" /f
    schtasks /create /tn "IORRT" /tr '"%SystemDrive%\IORRT\IORRT.bat"' /sc daily /mo 1 /ru ""
    cd /d "%InstallRoot%"
    cscript OSPP.VBS /dstatus
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    
    :Status
    mode con: cols=64 lines=21
    title IORRT
    cd /D "%InstallRoot%"
    cscript OSPP.VBS /dstatus
    schtasks /query | FINDSTR /I "IORRT"
    IF ERRORLEVEL 1 echo IORRT is not yet Installed
    echo.
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    
    :Exit
    This works good for me but get check (But then again it always worked for me but with no check til somewhere in the code something changed...lol)

    All this testing is for the masses and they are grateful you are helping me :)

    Please test
     
  10. tomah

    tomah MDL Senior Member

    Sep 25, 2010
    408
    355
    10
    #171 tomah, Dec 5, 2010
    Last edited by a moderator: Apr 20, 2017
    Try changing the line in RED to this:

    DEL %SystemDrive%\IORRT\Backup.hiv

    Ensure that after you have uninstalled IORRT, do this at command prompt:

    DEL "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtect ionPlatform\Backup.hiv"

    And then try everything.
     
  11. karrde

    karrde MDL Novice

    May 19, 2007
    22
    3
    0
    #172 karrde, Dec 5, 2010
    Last edited by a moderator: Apr 20, 2017
    Is there a special reason why the task is everyday deleted and recreated?
    I just ask because i (maybe) want to set "Run task as soon as possible after a scheduled start is missed" to prevent this restriction:
     
  12. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #173 timesurfer, Dec 5, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
    lol...I think I remember what disapeared :eek:

    Code:
    DEL %SystemDrive%\ProgramData\Microsoft\OfficeSoftwareProtectionPlatform\IORRT.bat
    And that's also where Backup.hiv sits :)

    But don't delete the cache or the token cause that is brick time...lol

    So we I figured out why those file keep reapearing and why I first deleted that when a month and a half ago I was getting two IORRT.bat files so I had to delete it at the source so it's done and we need testing everybody on these setups please

    1. 32 office on 32 Win7 or Vista
    2. 64 office on 64 Win7 or Vista
    3. 32 office on 64 XP

    Testers of the world unite for IORRT...lol

    Code:
    @echo off
    @color 0C
    title IORRT
    
    REM Variables
    set InstallRoot=
    set OfficeArchType=
    
    REM Check Office Architecture Type
    if '%processor_architecture%'=='x86' Set OfficeArchType=32 && Goto:EndArchCheck
    goto:WOWCheck
    
    :WOWCheck
    2>nul REG QUERY HKLM\SOFTWARE\Microsoft\Office\14.0\Common | find /i "InstallRoot" 1>nul
    IF ERRORLEVEL 1 Set OfficeArchType=WOW && Goto:EndArchCheck
    Set OfficeArchType=64
    
    :EndArchCheck
    
    REM Get Office Installed Path
    if %OfficeArchType%==WOW (
    FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Common\InstallRoot" /v Path') DO SET InstallRoot=%%B 
    Goto:FoundPath
    )
    FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Common\InstallRoot" /v Path') DO SET InstallRoot=%%B
    
    :FoundPath
    
    REM Start OSPPSVC (To make sure it is started to prevent strange cases where it doesn't start automatically from failing (XP))
    1>nul 2>nul net start osppsvc
    
    :MAINMENU
    mode con: cols=45 lines=10
    CLS
    echo.
    echo.
    echo.  
    echo.    InfiniteOfficeRestoreRearmTask (IORRT) 
    echo.    
    echo.               A. Install
    echo.               B. Uninstall
    echo.               C. Restore/Rearm
    echo.               D. Status
    echo.               E. Exit
    echo.
      
    :CHOOSEACTION
    set /p userinp=    ^   Make your selection: 
    set userinp=%userinp:~0,1%
    if /i "%userinp%"=="A" goto Install
    if /i "%userinp%"=="B" goto Uninstall
    if /i "%userinp%"=="C" goto Restore/Rearm
    if /i "%userinp%"=="D" goto Status
    if /i "%userinp%"=="E" goto Exit
    echo.Try Again...
    GOTO CHOOSEACTION
    
    :Install
    CLS
    mode con: cols=64 lines=21
    title IORRT
    schtasks /query | FINDSTR /I "IORRT"
    IF ERRORLEVEL 1 (
    echo Installing IORRT
    ) ELSE (
    echo IORRT has already been installed!
    echo.
    echo Press any key to return to the main menu
    PAUSE 1>nul
    GOTO MAINMENU
    )
    mkdir "%SystemDrive%\IORRT"
    net stop osppsvc
    xcopy /cheriky "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform" "%SystemDrive%\IORRT"
    reg save "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup.hiv
    net start osppsvc
    SET file=%SystemDrive%\IORRT\IORRT.bat
    IF EXIST %file% attrib -h %file% 
    echo @echo off >%file%
    echo net stop osppsvc >>%file%
    echo xcopy /cheriky "%SystemDrive%\IORRT" "%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" %SystemDrive%\IORRT\Backup.hiv >>%file%
    echo net start osppsvc >>%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 schtasks /delete /tn "IORRT" /f >>%file%
    echo schtasks /create /tn "IORRT" /tr "%SystemDrive%\IORRT\IORRT.bat" /sc daily /mo 1 /ru "" >>%file%
    IF Exist "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" ( 
    "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" 
    ) ELSE ( "%commonprogramfiles(x86)%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" 
    )
    schtasks /create /tn "IORRT" /tr "%SystemDrive%\IORRT\IORRT.bat" /sc daily /mo 1 /ru ""
    echo.
    
    cd /d "%InstallRoot%"
    cscript OSPP.VBS /dstatus
    
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    
    :Uninstall
    mode con: cols=64 lines=21
    title IORRT
    schtasks /query | FINDSTR /I "IORRT"
    IF '%ERRORLEVEL%' EQU '0' (
    echo Uninstalling IORRT
    ) ELSE (
    echo IORRT is already uninstalled
    echo.
    echo Press any key to return to the main menu
    PAUSE 1>nul
    GOTO MAINMENU
    )
    net stop osppsvc
    REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    REG RESTORE "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup.hiv
    DEL "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform\Backup.hiv"
    DEL %SystemDrive%\IORRT\Backup.hiv
    DEL %SystemDrive%\IORRT\IORRT.BAT
    DEL %SystemDrive%\ProgramData\Microsoft\OfficeSoftwareProtectionPlatform\IORRT.bat
    xcopy /cheriky "%SystemDrive%\IORRT" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform"
    net start osppsvc
    SET file=%SystemDrive%\IORRT
    IF EXIST %file% attrib -h %file%
    RD /S /Q  %file%
    DEL %SystemDrive%\ProgramData\Microsoft\OfficeSoftwareProtectionPlatform\IORRT.bat
    schtasks /delete /tn "IORRT" /f
    cd /d "%InstallRoot%"
    cscript OSPP.VBS /dstatus
    echo.
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    
    :Restore/Rearm
    mode con: cols=64 lines=21
    title IORRT
    schtasks /query | FINDSTR /I "IORRT"
    IF '%ERRORLEVEL%' EQU '0' (
    echo Restoring/Rearming IORRT
    ) ELSE (
    echo Install IORRT before you restore/rearm
    echo.
    echo Press any key to return to the main menu
    PAUSE 1>nul
    GOTO MAINMENU
    )
    net stop osppsvc
    xcopy /cheriky "%SystemDrive%\IORRT" "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform"
    REG DELETE HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    REG ADD HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform /f
    reg restore "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup.hiv
    net start osppsvc
    IF Exist "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" ( 
    "%CommonProgramFiles%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" 
    ) ELSE ( "%commonprogramfiles(x86)%\microsoft shared\OfficeSoftwareProtectionPlatform\OSPPREARM.exe" 
    )
    schtasks /delete /tn "IORRT" /f
    schtasks /create /tn "IORRT" /tr '"%SystemDrive%\IORRT\IORRT.bat"' /sc daily /mo 1 /ru ""
    cd /d "%InstallRoot%"
    cscript OSPP.VBS /dstatus
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    
    :Status
    mode con: cols=64 lines=21
    title IORRT
    cd /D "%InstallRoot%"
    cscript OSPP.VBS /dstatus
    schtasks /query | FINDSTR /I "IORRT"
    IF ERRORLEVEL 1 echo IORRT is not yet Installed
    echo.
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    
    :Exit
     
  13. tomah

    tomah MDL Senior Member

    Sep 25, 2010
    408
    355
    10
    Question:

    Not sure if anybody knows (maybe CODYQX4). Is there any difference between a copy of BACKUP.HIV just created now, and a copy from months ago. What I mean is, would an older copy of BACKUP.HIV have any advantages over a newly created copy? If so, we may want to put in a check.

    For those just joining us, BACKUP.HIV is a backup of "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform".
     
  14. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #175 timesurfer, Dec 5, 2010
    Last edited: Dec 5, 2010
    (OP)
    Well when I went forward in time to see what day nags come it was 25 and when I went past 30 days the backup worked but office doesn't like you going back in time

    I did every day to increase chances of peoples computer being on so task will run. It takes lie 6 seconds to run if someones comp is on

    Basically we want people to never have to be in notifications although if they do then just use "C" option they are good to go again ;)
     
  15. tomah

    tomah MDL Senior Member

    Sep 25, 2010
    408
    355
    10
    What I mean is. If I initially installed IORRT (which creates a copy of BACKUP.HIV) 3 months ago, but uninstall it now. Would there be any advantage to keep that BACKUP.HIV (from 3 months ago) over creating a brand new copy now when I install IORRT today? If there is an advantage, perhaps we should put in a check to keep it if it exists already.

    Another way of looking at it is. Will a copy of BACKUP.HIV from months ago be the same as one just created today?
     
  16. tomah

    tomah MDL Senior Member

    Sep 25, 2010
    408
    355
    10
    That's 1 less thing to worry about.:p
     
  17. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    At install it does one backup that's permanent and always restores off that so if you backup regularly then it would always be based off the first backup

    Did I answer that?