IR5 - The Official Windows 7 Rearm Solution

Discussion in 'MDL Projects and Applications' started by timesurfer, May 10, 2010.

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

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    The first date I see is 5 moths after my actual OS install date
     
  2. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,255
    675
    60
    Did you by any chance clear your system log?
     
    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
    Well we don't want same date for everybody do we? So what do we do set daz. What would you do in this situation

    1. Update dates are constant so any date after them is legit
    2. What date would you set in this situation?
    3. Setting no date would have the reset date be after install date of OS

    @MasterDisaster

    No
     
  4. Daz

    Daz MDL Developer / Admin

    Jul 31, 2009
    9,530
    67,271
    300
    #464 Daz, Jun 14, 2010
    Last edited: Jun 14, 2010
    What would I do? I would leave the dates well alone because even if you change the one date theres loads of others on the system that show evidence of trail resetting.

    It's easy to randomize a date so that everyone has them different but unless you're going to do that on a ton of stuff it's pointless unless you also offer a way to revert them all. You would also need a check in place in case someone runs the reset 2x or more which would overwrite the real original dates.

    I should also point out that WAT itself caches the last activation status, that too likely has the date stored in there.

    Personally I would think it'd be easier to keep it resetting the trial as it is (minus the date) and if it then gets blocked then work from there and try to figure out a way around it.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,255
    675
    60
    #465 MasterDisaster, Jun 14, 2010
    Last edited by a moderator: Apr 20, 2017
    Copy the following code in notepad and save it as FirstDate.xml
    Open Event Viewer, Click on Import Custom View and select the Xml file.
    You'll get your date and time
    Code:
    <ViewerConfig><QueryConfig><QueryParams><Simple><Source>Microsoft-Windows-Setup</Source><Channel>System</Channel><RelativeTimeInfo>0</RelativeTimeInfo><Task>3000</Task><BySource>True</BySource></Simple></QueryParams><QueryNode><Name>First Date</Name><QueryList><Query Id="0" Path="System"><Select Path="System">*[System[Provider[@Name='Microsoft-Windows-Setup'] and Task = 3000]]</Select></Query></QueryList></QueryNode></QueryConfig></ViewerConfig>
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,255
    675
    60
    #466 MasterDisaster, Jun 14, 2010
    Last edited by a moderator: Apr 20, 2017
    Here's a batch script that will query the event logs and set the install date to the time Windows 7 setup was completed.
    Code:
    @echo off
    echo. Querying Event logs for First System Date...
    echo. Please wait...
    echo. This process will take a few minutes to complete
    echo. Do not close this window
    echo.
    echo Set WshShell = CreateObject("WScript.Shell") >date.vbs
    echo strComputer = "." >>date.vbs
    echo Set objWMIService = GetObject("winmgmts:\\" ^& strComputer ^& "\root\CIMV2") >>date.vbs
    echo Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NTLogEvent Where Logfile='System' and EventCode='2003'",,48) >>date.vbs
    echo For Each objItem in colItems >>date.vbs
    echo dateTime = objItem.TimeGenerated>>date.vbs
    echo Next>>date.vbs
    echo abc = Split(dateTime, ".")>>date.vbs
    echo dateTime = Mid(abc(0),1, 4) ^& "/" ^& Mid(abc(0),5, 2) ^& "/" ^& Mid(abc(0),7, 2) ^& " " ^& Mid(abc(0),9, 2) ^& ":" ^& Mid(abc(0),11, 2) ^& ":" ^& Mid(abc(0),13, 2)>>date.vbs
    echo dateTime = DateAdd("n", -WshShell.RegRead("HKLM\System\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias"), dateTime) >>date.vbs
    echo WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\InstallDate", DateDiff("s", "70/1", DateAdd("n", WshShell.RegRead("HKLM\System\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias"), dateTime)), "REG_DWORD" >>date.vbs
    cscript /b date.vbs
    del date.vbs
    echo. Operation completed successfully.
    echo.
    systeminfo | Findstr /C:"Original Install Date:"
    pause
    
    Save the file as change.bat and Run as Administrator.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #467 timesurfer, Jun 14, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
    It seems to set the date as the RTM date

    In my event log it's actually 9/7/2009 3:57:55 and I put it in the other change.bat file but it didn't set it back

    Thank you

    I used this change.bat

    Code:
    @echo off
    echo Set WshShell = CreateObject("WScript.Shell") >date.vbs
    echo WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\InstallDate", DateDiff("s", "70/1", DateAdd("n", WshShell.RegRead("HKLM\System\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias"), 9/7/2009 3:57:55)), "REG_DWORD" >>date.vbs
    cscript /b date.vbs
    del date.vbs
    systeminfo | Findstr /C:"Original Install Date:"
    pause
     
  8. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,255
    675
    60
    You need to put the date and time in quotes like I have done.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
  10. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,255
    675
    60
    Check out my post in the Guide.
     
    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
    What post do you speak of? Link?
     
  12. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,255
    675
    60
    The usual post #30. I have commented the code. Makes it much easier to follow for others.
     
    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
    #474 timesurfer, Jun 14, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
  14. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,255
    675
    60
    #475 MasterDisaster, Jun 14, 2010
    Last edited: Jun 14, 2010
    Yes, it is the same code minus the XML stuff.

    Differences would be noticed only in the Task created

    - No delete immediately after trigger end date
    - No wake from sleep to run task
    - Configured for Vista & Server 2008

    Did I miss anything?
     
    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
    #476 timesurfer, Jun 14, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Just the user account and privileges

    Trippy we went and set that troublesome advanced setting the whole time but manually and yet we never had problems till yesterday...lol

    I don't get it...lol


    And here's the uninstall for that .bat file

    Code:
    @echo off
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Activation" /v NotificationDisabled /t REG_DWORD /d 0 /f >NUL
    schtasks /delete /tn "Rearm" /f
    pause
     
  16. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,255
    675
    60
    Uninstall file?

    Did I forget to mention in the comment, the uninstall file is also created by the same batch file.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    Yea I know removetask is created with 1.bat. It shows up when I haven't compiled everything with winrar

    So when I click the uninstall button on IR4 and it deletes task, what does removetask do. Do we have something twice. How does that work...lol
     
  18. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,255
    675
    60
    RemoveTask is the uninstall that gets created, it is the same script as your uninstall script. Only difference is you have it with you always, and I create it only if I have used the bat file. The removeTask created in the temp rar folder gets deleted as soon as the program is closed, so it is of no use in a self extracting archive.

    You can even remove the the "creates removetask.bat" part of 1.bat file.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  19. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #480 timesurfer, Jun 14, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Thats what I thought but it was one of those things I forgot to ask...lol

    Here's the code I'll remove:

    Code:
    SET file="%~dp0removeTask.bat"
    echo @echo off >%file%
    echo REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\Activation" /v NotificationDisabled /t REG_DWORD /d 0 /f ^>NUL >>%file%
    echo schtasks /delete /tn "Rearm" /f >>%file%
    echo pause >>%file%
    echo schtasks /query ^| FINDSTR /I "Rearm" >>%file%
    echo IF ERRORLEVEL 1 del "%%~0" >>%file%
    :end
    pause
    Or do I leave the

    Code:
    :end
    pause
    So basically you still need it with your console?