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,527
    4,112
    270
    Trying to find the easiest way to, at start, detect if in end of trial notifications or when watermark appears?

    Idea?

    1. Where in registry is watermark key and what is difference in that key when in/out of end of 30 day trial? Like a 1 or 0 is either or?
    2. When have watermark, then rearm, then watermark disappears. How does rearm do that? What does it trigger in registry to remove watermark?

    Thinking is to have onstart task "Hybrid2" check for that difference in registry, then if it detects, tells IR6 task to run and recreate it self

    This would best work with a .bat file that is put in %systemdrive% has code that "Hybrid2" tells to run and that .bat checks for the key setting

    So looking for path that rearm knows, since after rearm watermark disappears

    All this is to an end is to eliminate manual rearm which only is needed if rearm task does not run cause comp was off and task didn't run

    Then I could remove the rearm option in IR6 console and probably remove the restore/rearm option in IORRT too

    :shisha:
     
  2. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,466
    990
    60
    I read somewhere about being able to reset the rearm count with just a registry file.

    Got your PM's, will start messing with them today after I mow the lawn.

    I know this reg key "HKEY_CURRENT_USER\Control Panel\Desktop\PaintDesktopVersion" has to do with putting the "Windows 7 - Build 7601" on my desktop. Change the value to 1. Do not think that has anything to do with the water mark when your rearming.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    #123 timesurfer, Apr 17, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
  4. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,359
    7,078
    210
    There are actually two possible kinds of watermarks.

    First one is set with the "PaintDesktopVersion" value in "HKCU\\ControlPanel\\Desktop". (Windows 98, ME, 2000 and later)
    Second one is controlled by the "DisplayVersion" Value in "HKLM\\Software\\Microsoft\\Windows NT\\Windows". (only Windows 2000 and later)

    The former is user-specific, the latter system-wide. DisplayVersion overrides any PaintDesktopVersion value.

    In non-Genuine state, Windows ignores any of these registry keys set.
     
  5. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    #126 timesurfer, Apr 17, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Ok so where in registry does changes happen that can be queried is the question?

    Always run D420 as admin like right clicking it as admin would do?

    Looking to not just detect if D420 is ran as admin but force it to run as admin

    Code:
    %HOMEDRIVE%%HOMEPATH%
    or entry

    Code:
    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
    Select Right-click pane on the right -> New -> String Value.
    Enter C:\Windows\System32\cmd.exe as the NAME of the String Value.
    (where C:\ is your Windows drive letter)

    Double-click present created String Value and enter RUNASADMIN as Data Value

    :shisha:
     
  6. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,359
    7,078
    210
    Couldn't you just parse the

    cscript "%windir%\system32\slmgr.vbs" /dli

    command for the "License Status" line? If the grace expired it will change to Notification.
     
  7. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    #129 timesurfer, Apr 17, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
  8. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,466
    990
    60
    #130 Humphrey, Apr 18, 2013
    Last edited by a moderator: Apr 20, 2017



    Code:
    @echo off
    
    :: BatchGotAdmin
    :-------------------------------------
    REM  --> Check for permissions
    >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
    
    REM --> If error flag set, we do not have admin.
    if '%errorlevel%' NEQ '0' (
        echo Requesting administrative privileges...
        goto UACPrompt
    ) else ( goto gotAdmin )
    
    :UACPrompt
        echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
        set params = %*:"=""
        echo UAC.ShellExecute "%~s0", "%params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
    
        "%temp%\getadmin.vbs"
        exit /B
    
    :gotAdmin
        if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
        pushd "%CD%"
        CD /D "%~dp0"
    :--------------------------------------
    
    <YOUR BATCH SCRIPT HERE>
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,466
    990
    60
    #131 Humphrey, Apr 18, 2013
    Last edited by a moderator: Apr 20, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    #132 timesurfer, Apr 18, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Thank you guys that is very nice of you to contribute so much to D420 and it's becoming so nice with the new additions ;)

    1. Color customization
    2. New console window with direct download lniks
    3. The force admin code

    Second project in D420

    Query what Carlos suggested here

    This is really good idea to eliminate manual rearm if user has comp off when rearm should have run and is now in notifications

    Will just check if in initial grace period and take action or not from there!

    ----------------------------------------------

    Second project in D420

    Parts:

    1. "Hybrid2" task that runs at startup
    2. Check.bat that is triggered by "Hybrid2"

    If Carlos suggestion works via "Hybrid2" task that triggers a Check.bat at startup to query if in "initial grace period", if not then rearm, if yes then Check.bat exits, if can't rearm then give message

    So when I get this working I want to, if not in "initial grace period" restore theme/background

    Code:
    %appdata%\Microsoft\Windows\Themes
    Does anyone remember when desktop goes black does the contents of Themes still contain background, etc?
     
  11. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,466
    990
    60
    I am not sure what Carlos is saying to do. Please explan!
    Where did this hybrid2 service come from or is it just an idea that you want put into action?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    #134 timesurfer, Apr 18, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    :eek:

    Check.bat

    Code:
    @echo off
    title IR6
    mode con: cols=50 lines=12
    cscript.exe %windir%\system32\slmgr.vbs /dlv | FINDSTR /I "Initial grace period" >NUL
    IF ERRORLEVEL 0 ( goto exit >NUL
    echo.
    ) ELSE (
    schtasks /run | FINDSTR /i "IR6" >nul
    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
    REM restore %appdata%\Microsoft\Windows\Theme >NUL
    goto exit
    )
    IF ERRORLEVEL 1 ( echo It is time to re-install IR6... & pause & goto exit
    ) ELSE ( 
    )
    
    :Exit
    exit
    Hybrid2 Task

    Code:
    schtasks /create /tn "Hybrid2" /tr "%SystemDrive%\Check.bat" /sc onstart /ru "" >NUL
     
  13. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,466
    990
    60
    I installed a vmware copy of Windows 7 to use your Duality script.

    :dicht:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    #137 timesurfer, Apr 18, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
  15. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,466
    990
    60
    I am looking at that now. Honestly, I have no clue.

    Only thing I have thought of so far is only requesting admin when its about to do something that requires admin then having what actually requires admin pop out of the D420 cmd and run in its own that has admin.

    Also, been playing around with the lastest code release and the color selection is malfunctioning. I replaced its errorlevel with 1 (from 0) to get around that.

    I added a line or two of code so that it adds "(Alrdy Installed!) to the A. Install in the IR6 menu of duality- Thinking of what to do next.
    I requested halp from computing.net again, we'll see what they have to say about that request for admin. :smokecowboy:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    #139 timesurfer, Apr 18, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    IR6 works fine and already says IR6 is already installed when already installed

    The color selection works perfect for me, please say what exactly is not working and please post these codes in whole script with addition in green

    This helps me stay in touch with ideas someone has to contribute

    Thanks

    But really this is the code to examine, everything else is working fine although you say you found bug

    Check.bat

    Code:
    @echo off
    title IR6
    mode con: cols=50 lines=12
    cscript.exe %windir%\system32\slmgr.vbs /dlv | FINDSTR /I "Initial grace period" >NUL
    IF ERRORLEVEL 0 ( goto exit >NUL
    echo.
    ) ELSE (
    schtasks /run | FINDSTR /i "IR6" >nul
    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
    REM restore %appdata%\Microsoft\Windows\Theme >NUL
    goto exit
    )
    IF ERRORLEVEL 1 ( echo It is time to re-install IR6... & pause & goto exit
    ) ELSE ( 
    )
    
    :Exit
    exit
    Hybrid2 Task

    Code:
    schtasks /create /tn "Hybrid2" /tr "%SystemDrive%\Check.bat" /sc onstart /ru "" >NUL
    The errorlevel (return codes) has not been tested and I need to do the restore theme part but the general idea is good and what I've been talking about for weeks
     
  17. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,466
    990
    60
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...