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. peaceweapon

    peaceweapon MDL Novice

    Nov 8, 2010
    14
    3
    0
    #301 peaceweapon, Dec 9, 2010
    Last edited: Dec 9, 2010
    yes, c works, rearms perfectly, resets total minutes of Grace and keeps the same rearm count.

    I don't. I found it, but I can't find the task...
    I'll translate what I get in my IORRT when I do C:

    (...first part I can't see, ran too fast)
    Operation concluded with success.
    Operation concluded with success.
    Office Software protection Platform initiating
    Office Software protection Platform initiated with success
    Microsoft Office rearm successful.
    SUCCESS: Scheduled task "IORT" eliminated with success.
    SUCCESS: Scheduled task "IORT" created with success.
    The syntax of the name of the file, directory or label of the volume is incorrect.
    Microsoft <R> Windows Script Host version 5.8
    Copyright <C> Microsoft Corporation 1996-2001. All rights reserved.

    Entry error: It is not possible to find script file "C:\Windows\system32\OSPP.VBS".
    IORT 10-12-2010 19:32:00
    Ready
    Press any key to return to the main menu


    When I ask the status (d) it only says the same as above from "The syntax of the name of..." to the end.

    Rearms are the same - status according to Toolkit:
    ---------------------------------------
    SKU ID: 6f327760-8c5c-417c-9b61-836a98287e0c
    LICENSE NAME: Office 14, OfficeProPlus-KMS_Client
    LICENSE DESCRIPTION: Office 14, VOLUME_KMSCLIENT channel
    LICENSE STATUS: Grace Period
    Last 5 characters of installed product key: H3GVB
    REMAINING GRACE: 30 days (43184 minute(s) before expiring)
    ---------------------------------------


    yes, always

    Could it have anything to do with portuguese win7 software? something in the name of things? supposedly it is only portuguese for the reader, the "original codename" is always as in english software, as can be used in command prompt (? that's its name in english right?) isn't it?
     
  2. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,776
    150
    @timesurfer I see ospp.vbs is directing itself to system32.

    I get the folder for it (the install path), but you have to cd /d to that variable to call ospp.vbs otherwise it looks in system32 for it

    Did you change IORRT as it worked when I wrote my last edit of it.
     
  3. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #304 timesurfer, Dec 9, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
    I only found one thing in red...lol
    Code:
    @echo off
    @color 0C
    title IORRT 1.9
    
    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 1.9
    schtasks /query | FINDSTR /I "IORRT" >NUL 
    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\Backup\Files\Tokens"
    mkdir "%SystemDrive%\IORRT\Backup\Registry"
    reg save "HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" %SystemDrive%\IORRT\Backup\Registry\OfficeSPPInfo.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\Backup\Files\Tokens" "%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\Registry\OfficeSPPInfo.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 "Hybrid" /tr "%SystemDrive%\IORRT\IORRT.bat" /sc onstart /ru ""
    schtasks /create /tn "IORRT" /tr "%SystemDrive%\IORRT\IORRT.bat" /sc daily /mo 1 /ru ""
    echo.
    cd /d "%InstallRoot%"
    cscript OSPP.VBS /dstatus
    schtasks /query | FINDSTR /I "IORRT"
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    
    :Uninstall
    mode con: cols=64 lines=21
    title IORRT 1.9
    schtasks /query | FINDSTR /I "IORRT" >NUL
    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
    xcopy /cheriky "%SystemDrive%\IORRT\Backup\Files\Tokens" "%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\Registry\OfficeSPPInfo.hiv
    net start osppsvc
    DEL "%ALLUSERSPROFILE%\Microsoft\OfficeSoftwareProtectionPlatform\Backup.hiv"
    SET file=%SystemDrive%\IORRT
    IF EXIST %file% attrib -h %file%
    RD /S /Q  %file%
    schtasks /delete /tn "Hybrid" /f
    schtasks /delete /tn "IORRT" /f
    cd /d "%InstallRoot%"
    cscript OSPP.VBS /dstatus
    schtasks /query | FINDSTR /I "IORRT"
    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 1.9
    schtasks /query | FINDSTR /I "IORRT" >NUL 
    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\Backup\Files\Tokens" "%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\Registry\OfficeSPPInfo.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
    schtasks /query | FINDSTR /I "IORRT"
    echo.Press any key to return to the main menu
    pause > nul
    GOTO MAINMENU
    )
    
    :Status
    mode con: cols=64 lines=21
    title IORRT 1.9
    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
     
  4. peaceweapon

    peaceweapon MDL Novice

    Nov 8, 2010
    14
    3
    0
    Hi
    Yes I was using 1st post version, at least it's 1.9 too.... I don't remember if I DL from elsewhere... I might have...
    I was trying to use Task Scheduler to make IORRT run and autoselect c everytime the PC starts, with privileges, in the background, and closing in the end... I am using the IORRT.bat (not the IORRT 1.9.bat), that seems to do the C option alone, is that ok?
     
  5. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #307 timesurfer, Dec 9, 2010
    Last edited: Dec 9, 2010
    (OP)
    Yea we got IORRT 1.9.bat (my console) that installs the IORRT.bat in c:\ to be run by IORRT and Hybrid tasks

    So the tasks and C do exact same thing

    Really we don't need C anymore as someone stated but I kept it so people could easily test and to easily reset time of day IORRT runs since when IORRT restores/rearms it also resets task to present time/date

    Hybrid task will only run at startup but if you run it in task scheduler it will run the bat in c:\

    How hard would it be to reinstall your OS and office so you can start from scratch and not get any errors :eek:...lol
     
  6. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,776
    150
    I personally tested the Hybrid in AutoRearm by running the startup task manually and seeing if it reset the daily time, and I'd already known restore/rearm worked. All I did was put the functions for task in it and reset the daily at the end of the program.
     
  7. peaceweapon

    peaceweapon MDL Novice

    Nov 8, 2010
    14
    3
    0
    Errors don't matter.
    I finally found the IORRT and Hybrid... I'm ashamed to confess I didn't really know how to look for it, though that I had to go through each of the smaller directories, but the tasks were in the library directory, that also contains the rest... I'm really new for this.
    So I hope the error is meaningless... One problem though, I'm using PC in battery mode right now, I often do... it doesn't let it work if it is in not AC connected... Could you fix it? It's only unticking 2 options in "conditions" tab in properties, but everytime it recreates the task process during rearm it resets those options... also there is no tick in highest privilege execution, I don't know if it will run that way...
    I might do the new task anyway with those definitions...
     
  8. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    So pretty much both tasks run autorearm.exe which thinks on it's own what to do. I think I knew that?

    Where do you put your backups?
     
  9. peaceweapon

    peaceweapon MDL Novice

    Nov 8, 2010
    14
    3
    0
    #311 peaceweapon, Dec 10, 2010
    Last edited: Dec 10, 2010
    Just for information, my created task works perfectly so the errors are no problem nor the problem of the IORRT/Hybrid tasks. Just scheduled to run IORRT.bat on startup and given time, independently of energy source, and using highest privileges.

    THANK YOU SOOOOOOO MUCH, timesurfer and cody!!! :D You saved my work! :)
     
  10. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,776
    150
    #312 CODYQX4, Dec 10, 2010
    Last edited: Dec 11, 2010
    C:\windows\AutoRearm folder has exe and backups in subfolder. It thinks on its own because it uses the classes and toolkit code/functions, just uses a loop to apply them in this specific way. I learned of the rearm technique because I backup Office when messing with it and I did rearm testing and found rearms restored when restoring backup. I just built a loop and if statements around calls to the needed functions and AutoRearm was born out of the toolkit in 5 minutes with assurance the code worked since it's gone through all the toolkit testing and betas. I haven't heard a bug report from 2.0.1 yet and I don't count KMS errors. The one confirmed bug in 2.0 i fixed was AV created.

    One person said the Key Checker crashed but I could not reproduce it and only had one report so just noted it for now.

    I think IORRT vs Autorearm equal out as the way we handle things efficiency wise counter balance (and everything else is the same). The fact that I don't restore or rearm unless needed saves it but when a restore is needed it determined so by rearming so it would be like a second or two slower than IORRT because it would rearm(fail)-restore-rearm vs restore-rearm.

    I think its a stable solution but I had an idea for mine to make it even more flexible. As you are aware you can have multiple versions of Office 2010 installed. I got MAK activation before the key died on Pro Plus. If I wanted to AutoRearm/IORRT Visio/Project (I don't have them installed now but used to) it would knock out the MAK activation as rearm rearms everything.

    It is possible to rearm products individually though. The OSPPC.dll (which is not figured out) can rearm by passing a SKUID (you see it in Check Activation Status) and rearm just that product. If you look back to rearm guides for old betas you'll see you had to use OSPPRUN to get and pass a SKUID to rearm one product and do it for all of them.

    This adds flexibility but it also complicates things as well. I rely on the rearm count being constant for all apps as there is no way out there to make it otherwise currently. If we made individual rearm possible (which I want to add to toolkit) we'd have to check each product's rearm count. If I could get that call working (I think Daz might look at it) I can get the rearm count per SKUID. I'd likely add it to activation status and nuke the "Available" button. Probably would move rearm to license management so it could use the selector and it would make sense since a non-IORRT/AutoRearm is not activation anyway.

    Basically what I want from OSPPC.dll is:
    1.Get Rearm Count
    2.Individual Rearm
    3.Uninstall License (this could let me test some new tricks as this is effectively an uninstall as far as license database is concerned)
    4.GetInstalledSKUIDs (Would make the Getting Office Config in EZ-Activator way more efficient)

    PS: Do you have the ospprun.exe?

    EDIT: The above DLL stuff turned out to be absolutely worthless and not what I expected.
     
  11. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,776
    150
    OK I got that OSPPRUN.

    I think if I can script to that file from C#, I will add the features based on OSPPRUN until we can figure out how to do it ourself.

    Right now I want to see what happens when you uninstall licenses.
     
  12. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    If you need testing just ask...lol
     
  13. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,776
    150
    Right now the battle is calling it from C# and getting the output. I'm gonna ask on Mixed Coding but I just learned how to pass input to an external app so that is a good thing.
     
  14. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    Did that .vbs or bat I gave you help?
     
  15. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,776
    150
    No just the OSPPRUN.exe. If you look in the Calling a DLL Help thread I posted, that is a list of commands.

    Basically OSPPRUN.exe does the DLL or OSPPSVC talking as we don't know how to do so ourself. I'm using it since I can test features and simply replace OSPPRUN with the needed code whenever necessary.

    Right now I'm working on Uninstall Licenses. I have a way to pass the SKUs I have hardcoded, to get some code, and pass that code/id to get a different code/id. Dump the last IDs all into the UninstallLicense function of OSPPRUN and it uninstalls your slics. I manually removed ProPlus Academic MAK. I'm trying to see how office behaves when I manipulate licenses as it may be possible to reset rearms or escape notifications brick if they uninstall clean without OSPPSVC keeping record. Office Uninstall removes them but some people get grace and some people get notifications on reinstall of office.

    The fact I have new tools and functions of OSPPSVC I could not achieve with WMI (Which has much more than ospp.vbs) gives me more power over office and lets me test and break and fix things to see how office responds so I learn more about it.
     
  16. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    Every time I was in notifications it always installed in the same status

    So something is stored somewhere that insists office be installed in former status?
     
  17. CODYQX4

    CODYQX4 MDL Developer

    Sep 4, 2009
    4,813
    45,776
    150
    I've thought maybe leftover reg keys as the tokens + OSPP stuff that get backuped in the hive file both get nuked.
     
  18. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    Dude this would be great discovery for troubleshooting office for rearm concept:D