Rearm Wizard - The Premier Rearm Solution for Windows 7 and Office 2013

Discussion in 'MDL Projects and Applications' started by timesurfer, Mar 27, 2013.

  1. timesurfer

    timesurfer MDL Developer

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

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    #202 Humphrey, Apr 20, 2013
    Last edited by a moderator: Apr 20, 2017
    Check.bat will have to be called with the variable to make it minimized or hidden

    Something like this?

    (untested)
    Code:
    @echo off
    
    setlocal ENABLEEXTENSIONS >nul
    SET wppath=%appdata%\Microsoft\Windows\Themes >nul
    SETX vstore "%appdata%\..\Local\VirtualStore\IR6" >nul
    mkdir %vstore% >nul
    set KEY_NAME=HKCU\Software\Microsoft\Windows\CurrentVersion\Themes
    set VALUE_NAME=CurrentTheme
    set spp=SoftwareLicensingProduct
    echo. >>%vstore%\IR6Bkup.theme >nul
    echo. >>%vstore%\TranscodedWallpaper.jpg >nul
    for /F "usebackq tokens=3" %%A IN (`reg query "%KEY_NAME%" /v "%VALUE_NAME%" 2^>nul ^| find "%VALUE_NAME%"`) do (
      SET themefile=%%A
    )
    xcopy "%wppath%\TranscodedWallpaper.jpg" "%vstore%\TranscodedWallpaper.jpg" /Y
    xcopy "%themefile%" "%vstore%\IR6Bkup.theme" /Y
    
    
    wmic path %spp% get LicenseStatus /format:list 2>nul | findstr /i 5 >nul 2>&1
    if %errorlevel% EQU 0 (
    
    
    for /f "usebackq tokens=2 delims==" %%n in (`"%SystemRoot%\System32\wbem\WMIC.exe" /namespace:\\root\cimv2 path SoftwareLicensingService get RemainingWindowsReArmCount /format:list`) do set r=%%n
    if %r% == 0 REM <Send message to user to Reinstall IR6>
    
    schtasks  /create /tn "IR6" /tr  "'%SystemDrive%\Windows\system32\cmd.exe' /c  cscript.exe /b  %SystemDrive%\Windows\System32\slmgr.vbs /rearm  && net stop  sppsvc && net start sppsvc" /sc daily /mo 30  /ru "" /f >NUL
    "'%SystemDrive%\Windows\system32\cmd.exe' /c  cscript.exe /b  %SystemDrive%\Windows\System32\slmgr.vbs /rearm  && net stop  sppsvc && net start sppsvc" >NUL
    
    xcopy "%vstore%\TranscodedWallpaper.jpg" "%wppath%\TranscodedWallpaper.jpg" /Y
    xcopy "%vstore%\IR6Bkup.theme" "C:\Windows\resources\Themes\IR6Bkup.theme" /Y
    reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Themes"  /t  REG_SZ /v CurrentTheme /d "C:\Windows\resources\Themes\IR6Bkup.theme" /f >NUL
    %vstore%\IR6Bkup.theme
    )
    exit
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #203 timesurfer, Apr 20, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    I will be putting Check.bat into IR6 like I put IORRT.bat in IORRT

    Code:
    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 "%ProgramFiles%\Microsoft Office\Office15\OSPPREARM.exe" ( >>%file%
    echo "%ProgramFiles%\Microsoft Office\Office15\OSPPREARM.exe" >>%file%
    echo ) ELSE ( "%programfiles(x86)%\Microsoft Office\Office15\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%
    Code:
    schtasks /create /tn "Hybrid2" /tr "%SystemDrive%\Check.bat" /sc onstart /ru "" >NUL
    Stuff in green runs silent or hidden :eek:
     
  4. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #204 timesurfer, Apr 20, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Wow as a rearm concept team, we fulfilled the rearm concept prophecy to make the third most used solution, the rearm concept solution, as good as it can be!

    This project of mine would have never come about if it wasn't for the tireless devotion to MDL development and service to those who like to test MS products for a little longer than MS allows in trial

    Things accomplished:

    1. Eliiminated manual rearm concept
    2. Implemented direct links for W7/Office 2013
    3. Gave D420 users color customization
    4. Created desktop theme/background backup and restore concept

    Good job everyone and thank you for all your help

    :shisha:

    I'm sure we'll have a full new working IR6 in a couple of days

    Is WPA key delete from inside windows possible? If so IR6 will go through complete transformation otherwise the rearm concept has elevated to an to be contended solution for using W7 with same usage and appearance as if activated for 180 days (6 months) while leaving all systems files untouched/undamaged with excellent support and a little amusement in development and no .bootsect brick :suicide:

    Will be compiling a list of all who helped me with my rearm concept developments on first page of D420 as to recognize how many thousands of hours has gone into this trial based concept and all those who gave their time and expertise in assisting me and being patient in my intermdiate batch skills whilst entertaining my original ideas and enthusiasm for the 3rd most popular W7 solution

    1. Daz
    2. Cody
    3. TS

    Some MDL members to maybe be listed in first page as co-developers or significant contributers in the D420/IR6/IORRT project as follows:

    Code:
    BOX-
    Madsheep!
    PAYMYRENT
    MasterDisaster
    CODYQX4
    tomah
    Tito
    qewlpal
    Humphrey
    slave77
    Bosh
    chnix
    Daz
    Claysoft65
    NTmarta
    dareckibmw
    tuvi123
    Mr Jinje
    SuperUser
    and a few more that I will go throughout the entire Rearm Concept Archives to find and list as honestly as possible

    If anyone remembers who else to recongnize in my project please leave post or if you feel you deserve to be on D420 first page list please post

    All this wouldn't have been possible without the facilitation of the MDL owner, all admins, moderators and the genuine enthisiasm of the sharing and caring spirit of developing safe and fun solutions to enjoy MS products and to learn and grow as coders and software developers

    Thanks again

    TS :shisha:
     
  5. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,761
    7,692
    210
    If you backup the theme, why the TranscodedWallpaper.* also? Doesn't selecting the theme restore it automatically? Additionally, when using Desktop Slideshow, the TranscodedWallpaper.* changes regularly, anyway.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    I thought about the slide show problem.
    And if it doesn't require it we can easliy take it out, less room D420 requires now.

    Thanks.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,761
    7,692
    210
    Re-selecting the theme restores the slideshow.

    Transcoded Wallpaper is only a temporary copy, it will be overwritten whenever a new background image is established (no matter which way).
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    #208 Humphrey, Apr 20, 2013
    Last edited by a moderator: Apr 20, 2017
    Code:
    @echo off
    setlocal ENABLEEXTENSIONS
    echo. >>%vstore%\IR6Bkup.theme
    SET vstore "%localappdata%\VirtualStore\IR6" >nul
    set KEY_NAME=HKCU\Software\Microsoft\Windows\CurrentVersion\Themes
    set VALUE_NAME=CurrentTheme
    for /F "usebackq tokens=3" %%A IN (`reg query "%KEY_NAME%" /v "%VALUE_NAME%" 2^>nul ^| find "%VALUE_NAME%"`) do (
      SET themefile=%%A
    )
    mkdir %vstore% >nul
    :choice
    cls
    Echo A) Back-Up Background/Theme
    Echo.
    Echo B) Restore Background/Theme
    echo.
    echo C) Exit
    Echo.
    choice /C ABC /N /M "Select one of the options above (A-C):"
    if ERRORLEVEL 3 exit
    if ERRORLEVEL 2 goto Restore
    if ERRORLEVEL 1 goto Backup
    :Backup
    CLS
    xcopy "%themefile%" "%vstore%\IR6Bkup.theme" /Y
    Pause
    GOTO CHOICE
    :Restore
    CLS
    xcopy "%vstore%\IR6Bkup.theme" "C:\Windows\resources\Themes\IR6Bkup.theme" /Y
    %vstore%\IR6Bkup.theme
    Pause
    GOTO CHOICE
    That also can be done.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,761
    7,692
    210
    SETX vstore "%appdata%\..\Local\VirtualStore\IR6" >nul

    Instead of %APPDATA%\..\Local, couldn't you just use %LOCALAPPDATA%?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    #211 Humphrey, Apr 20, 2013
    Last edited by a moderator: Apr 20, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #212 timesurfer, Apr 20, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
  12. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,093
    24,397
    340
    Yep, unfortunately slmgr.vbs output is language-specific. Tested in my server service config script and it failed on other languages, when trying to find localised strings in slmgr.vbs.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #214 timesurfer, Apr 20, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Go ahead and remove the pink code if you guys want and build upon that to add the color, eliminate rearm, and theme stuff

    Please look over your Check.bat code and post that so I can add or you can look at how I add the install IORRT.bat code and do it yourself if you want

    This code was tested on multiple languages and works

    Code:
    schtasks  /create /tn "IR6" /tr  "'%SystemDrive%\Windows\system32\cmd.exe' /c  cscript.exe /b  %SystemDrive%\Windows\System32\slmgr.vbs /rearm  && net stop  sppsvc && net start sppsvc" /sc daily /mo 30  /ru "" /f >NUL
    Code:
    cscript.exe /b %windir%\system32\slmgr.vbs /rearm
    Code:
    cscript.exe %windir%\system32\slmgr.vbs /dlv | FINDSTR /I "Status"
    echo.
    cscript.exe %windir%\system32\slmgr.vbs /dlv | FINDSTR /I "Remaining"
    Code:
    cscript OSPP.VBS /dstatus | FINDSTR /i "Status"
    cscript OSPP.VBS /dstatus | FINDSTR /i "Remaining"
    Let's bust out the full D420 code with all additions

    Check.bat addition can be added to IR6 install or I can do that?

    Be back soon and thanks again!
     
  14. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,093
    24,397
    340
    #215 s1ave77, Apr 20, 2013
    Last edited by a moderator: Apr 20, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    18,803
    18,983
    340
    So its time for switch to WMI.

    :popcorn:
     
  16. qewlpal

    qewlpal MDL Addicted

    Jun 25, 2010
    575
    2,014
    30
    What are the use cases are you using slmgr with ?
    You can replace them with wmi querying, it just works.
    @Tito: lol..you beat me to it..
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,093
    24,397
    340
    Don´t use them myself, it´s from duality code.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #219 timesurfer, Apr 20, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
  19. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,093
    24,397
    340
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...