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

    Stannieman MDL Guru

    Sep 4, 2009
    2,228
    1,816
    90
    Isn't there an option to use system, like /rl system or something like that. I'm almost shure there is cause I also made a batch once that created tasks. With system permission I thought the task even runs without any users logged on, so when just the logonscreen is showing the task will still run.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,255
    675
    60
    #522 MasterDisaster, Jun 16, 2010
    Last edited by a moderator: Apr 20, 2017
    Try the following code, I convert the group id to name and use the /ru switch.

    Code:
    for /f "tokens=4 delims==, " %%A in ('"wmic /Namespace:\\root\cimv2 path Win32_AccountSID|find "S-1-5-32-545""') do ( set cname=%%A )
    schtasks /create /tn "Rearm" /tr "'C:\Windows\system32\cmd.exe' /c cscript.exe /b C:\Windows\System32\slmgr.vbs /rearm && 'C:\Windows\system32\shutdown.exe' -r -t 90 -c 'Please save your work. Windows will reboot in 90 seconds'" /sc daily /mo 30 /ru %cname% /rl "highest" /f
    IF ERRORLEVEL 1 echo Run this batch file as Administrator
    
    @ Stannieman

    Using SYSTEM makes the process invisible to the user, we need to display a warning that Windows is going to reboot. That is why we are using the Users group which will run interactively.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. hell tourist

    hell tourist MDL Novice

    Feb 10, 2010
    9
    39
    0
    It is /ru SYSTEM and it will run in background if a user is logged on with a normal user account.
     
  4. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #524 timesurfer, Jun 16, 2010
    Last edited by a moderator: Sep 14, 2014
    (OP)
    MasterDisaster can you please check the XML in this so it's as perfect as it can be


    @hell tourist

    Try this
     
  5. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,255
    675
    60
    The XML file is fine, noticed you have unchecked power options.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. hell tourist

    hell tourist MDL Novice

    Feb 10, 2010
    9
    39
    0
    #526 hell tourist, Jun 16, 2010
    Last edited by a moderator: Sep 14, 2014
    It creates the task
     
  7. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,255
    675
    60
    @ hell tourist

    Can you try this code.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. hell tourist

    hell tourist MDL Novice

    Feb 10, 2010
    9
    39
    0
    #528 hell tourist, Jun 16, 2010
    Last edited: Jun 16, 2010
    It stops with bad syntax.
     
  9. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,255
    675
    60
    Thank you for your feedback

    @timesurfer

    You can prune some of the unneeded code in 1.bat

    For the first Line how about "Click OK to restart your PC and do the following steps"
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #531 timesurfer, Jun 16, 2010
    Last edited: Jun 16, 2010
    (OP)
    Which .bat code do I use now. Are we eliminating XML again...lol I don't want any boxes checked and I don't think we can do that with just task install. It has to imported.

    Thanks for your grammar feedback MD
     
  11. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,255
    675
    60
    No, you can keep the XML file. I'll provide you a new batch file.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,255
    675
    60
    #534 MasterDisaster, Jun 16, 2010
    Last edited: Jun 16, 2010
    You have disabled the trigger in the task.

    In the XML file set Enabled to true just below StartBoundary
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. Stannieman

    Stannieman MDL Guru

    Sep 4, 2009
    2,228
    1,816
    90
    Why are you actually using batch files? Isn't it better to use a real exe program? You can add a lot more error handling then, things like if it rearms then check whether windows is still in trail, and when it's out of trail a popup can come up to let the user know the pc needs another reboot to get things in place again etc. You can even let the user chose what the time between rearms should be, where the exe that does the rearm job is placed and which name it has etc.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #536 timesurfer, Jun 16, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
  15. Stannieman

    Stannieman MDL Guru

    Sep 4, 2009
    2,228
    1,816
    90
    I see, but why is it neccessary to press F8 on reboot? Anyway, I started to make a simular program some time ago but stopped development, I'll pm all the files to you if you want. It isn't finished, but I think the installer was nearly completed, the rearm exe still needs more work. It's a vb.net 2008 project
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
  17. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,524
    4,112
    270
    #539 timesurfer, Jun 17, 2010
    Last edited by a moderator: Sep 14, 2014
    (OP)
  18. MasterDisaster

    MasterDisaster MDL Expert

    Aug 29, 2009
    1,255
    675
    60
    The easier way to know when the grace period expires is slmgr /xpr
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...