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

    Compo MDL Member

    Mar 29, 2011
    136
    106
    10
    #1221 Compo, Apr 1, 2014
    Last edited by a moderator: Apr 20, 2017
    The problem with that is that if the default has never been changed i.e.0x0, you cannot use COLOR 0.
    What about:
    Code:
    (Set _CLR=07)
    For /f "tokens=2 delims=x" %%a In (
    'Reg Query "HKCU\Software\Microsoft\Command Processor" /v "DefaultColor"'
    ) Do If %%a Neq 0 (Set _CLR=%%a)
    Then use COLOR %_CLR% to set to defaults, or COLOR to set the that which was set when the console opened.
     
  2. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    The latest code you've posted isn't working in my VM. I tell it to install and it blanks out, just a flashing _ (underscore.) I try install again, tells me it already is installed.

    I am placing "ECHO.Marker#1&Pause" in locations to try and find out where it stops working.
     
    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
    #1223 timesurfer, Apr 1, 2014
    Last edited by a moderator: Apr 20, 2017
    (OP)
  4. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    #1224 Humphrey, Apr 1, 2014
    Last edited by a moderator: Apr 20, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Compo

    Compo MDL Member

    Mar 29, 2011
    136
    106
    10
    #1225 Compo, Apr 1, 2014
    Last edited by a moderator: Apr 20, 2017
    In the ReinstallIR7 Section The following sequence should be replaced…
    Code:
    echo schtasks /create /tn "Key" /tr "%SystemDrive%\Trial\IR7.bat" /sc onlogon /ru "" ^>nul >>%SystemDrive%\Trial\IR7\IR7.bat
    echo REG SAVE HKLM\SYSTEM %TEMP%\SYSTEM.HIV /y >NUL 2>&1 >>%SystemDrive%\Trial\IR7\IR7.bat
    echo REG RESTORE HKLM\SYSTEM %TEMP%\SYSTEM.HIV >NUL 2>&1 >>%SystemDrive%\Trial\IR7\IR7.bat
    echo del %TEMP%\SYSTEM.HIV >NUL 2>&1 >>%SystemDrive%\Trial\IR7\IR7.bat
    echo POWERSHELL -command rename-item HKLM:\SYSTEM\WPA -NewName WPA_Delete >NUL 2>&1 >>%SystemDrive%\Trial\IR7\IR7.bat
    echo REG DELETE HKLM\SYSTEM\WPA_Delete /f >NUL 2>&1 >>%SystemDrive%\Trial\IR7\IR7.bat
    echo schtasks /delete /tn "Msgbox" /f ^>nul>>%SystemDrive%\Trial\IR7\IR7.bat
    echo del /F /Q %SystemDrive%\Trial\Msgbox.bat ^>nul>>%SystemDrive%\Trial\IR7\IR7.bat
    with this to correct the nesting problems you still haven't fully addressed!
    Code:
    echo schtasks /create /tn "Key" /tr "%%SystemDrive%%\Trial\IR7.bat" /sc onlogon /ru "" ^>nul >>%SystemDrive%\Trial\IR7\IR7.bat
    echo REG SAVE HKLM\SYSTEM %%TEMP%%\SYSTEM.HIV /y ^>NUL 2^>^&1 >>%SystemDrive%\Trial\IR7\IR7.bat
    echo REG RESTORE HKLM\SYSTEM %%TEMP%%\SYSTEM.HIV ^>NUL 2^>^&1 >>%SystemDrive%\Trial\IR7\IR7.bat
    echo del %TEMP%\SYSTEM.HIV ^>NUL 2^>^&1 >>%SystemDrive%\Trial\IR7\IR7.bat
    echo POWERSHELL -command rename-item HKLM:\SYSTEM\WPA -NewName WPA_Delete ^>NUL 2^>^&1 >>%SystemDrive%\Trial\IR7\IR7.bat
    echo REG DELETE HKLM\SYSTEM\WPA_Delete /f ^>NUL 2^>^&1 >>%SystemDrive%\Trial\IR7\IR7.bat
    echo schtasks /delete /tn "Msgbox" /f ^>nul >>%SystemDrive%\Trial\IR7\IR7.bat
    echo del /F %%%%0 ^>nul >>%SystemDrive%\Trial\IR7\IR7.bat
    Try implementing it and seeing if it helps.
     
  6. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #1226 timesurfer, Apr 1, 2014
    Last edited by a moderator: Apr 20, 2017
    (OP)
  7. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #1227 timesurfer, Apr 1, 2014
    Last edited by a moderator: Apr 20, 2017
    (OP)
  8. Compo

    Compo MDL Member

    Mar 29, 2011
    136
    106
    10
    #1228 Compo, Apr 1, 2014
    Last edited by a moderator: Apr 20, 2017
    The only references to system32 in that code would be from the scheduled tasks, are you sure they have run?

    Incidentally in the /TR section of the scheduled task, system32 is assumed if the path is not given so you should be able to shorten those two lines accordingly.
    From:
    Code:
    echo schtasks /create /tn "IR7" /tr "'%%SystemDrive%%\Windows\system32\cmd.exe' /c cscript.exe /b C:\Windows\System32\slmgr.vbs /rearm && net stop sppsvc && net start sppsvc" /sc daily /mo 30 /ru "" /f ^>nul >>%SystemDrive%\Trial\IR7\IR7.bat
    To:
    Code:
    echo schtasks /create /tn "IR7" /tr "cmd /c cscript /b slmgr.vbs /rearm && net stop sppsvc && net start sppsvc" /sc daily /mo 30 /ru "" /f ^>nul >>%SystemDrive%\Trial\IR7\IR7.bat
    and
    From:
    Code:
    schtasks /create /tn "IR7" /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
    To:
    Code:
    schtasks /create /tn "IR7" /tr "cmd /c cscript /b slmgr.vbs /rearm && net stop sppsvc && net start sppsvc" /sc daily /mo 30 /ru "" /f >nul
    There is something in the code which will always generate an error, a harmless one but an error always appears as the console closes.
    Change this line:
    Code:
    echo echo del /F /Q %%%%0^^^>nul^>^>%%systemdrive%%\Trial\IR7.bat>>%SystemDrive%\Trial\IR7\IR7.bat
    to this for a fix:
    Code:
    echo echo start /b cmd /c del "%%%%~f0"^^^&exit /b ^>^>%%systemdrive%%\Trial\IR7.bat >>%SystemDrive%\Trial\IR7\IR7.bat
     
  9. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #1229 timesurfer, Apr 1, 2014
    Last edited by a moderator: Apr 20, 2017
    (OP)
  10. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #1230 timesurfer, Apr 2, 2014
    Last edited by a moderator: Apr 20, 2017
    (OP)
  11. Compo

    Compo MDL Member

    Mar 29, 2011
    136
    106
    10
    #1231 Compo, Apr 2, 2014
    Last edited by a moderator: Apr 20, 2017
    If you've only provided an OK button then the return value, (ERRORLEVEL), when pressed will be 1

    EDIT
    Because you only have one option for that box, 1 will always be returned!

    So you could just remove the %ERRORLEVEL% line and go straight to the DELETE and SHUTDOWN lines!
     
  12. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    Well I tried as I posted with errorlevel 0 and it worked

    I'll go test your way now...
     
  13. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #1233 timesurfer, Apr 2, 2014
    Last edited by a moderator: Apr 20, 2017
    (OP)
  14. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,767
    7,699
    210
    Will test this over the weekend (or so I intend to do, lol). :1eye:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #1238 timesurfer, Apr 5, 2014
    Last edited by a moderator: Apr 20, 2017
    (OP)
  16. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    #1239 Humphrey, Apr 5, 2014
    Last edited by a moderator: Apr 20, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. darkcraft

    darkcraft MDL Novice

    Apr 5, 2014
    1
    0
    0
    I executed the bat script on my computer and my trial went down to 3 days from 8 days... :) What did I do wrong? :eek: