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
    Just to reiterate, I want to have IORRT and Check.bat/theme stuff ALL in one Rearm folder in %systemdrive%

    This will require error checking as to the existance or non-existance of rearm folder for both install and unistall for IR6/IORRT stuff

    IR6 part is started, IORRT is not started!

    :eek:
     
  2. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,093
    24,397
    340
    #702 s1ave77, Jun 27, 2013
    Last edited by a moderator: Apr 20, 2017
    Needs to be %%a and %%c and only shows "Home" or "Professional" mostly with a space.

    Using here:
    Code:
    @Echo Off
    for /f "tokens=2,3,4,5,6,7 delims= " %%a in ('wmic os get caption') do set ver=%%a %%b %%c %%d %%e %%f
    :loopV
    if "%ver:~-1%"==" " set "ver=%ver:~0,-1%" & goto :loopV
    echo version: %ver%#
    pause 
    Output on my Win 8 Pro WMC:
    Code:
    version: Windows 8 Pro with Media Center#
    Drücken Sie eine beliebige Taste . . .
    Output on Win 7 Home Basic:
    Code:
    version: Windows 7 Home Basic#
    Press any key to continue . . .
    No spaces...no errors :hmm:.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    #703 Humphrey, Jun 27, 2013
    Last edited by a moderator: Apr 20, 2017
    Not sure what you are getting at there s1ave.

    I get:
    Code:
    version: Windows 7 Ultimate#
    when using the code you posted.

    Are you trying to remove the # symbol?


    Are you saying the code I posted only gives you HOME for home basic cause I removed the extra's?

    If so then just add %C and %D and you will get HOME BASIC
    as for trying to get it to work with Windows 8 anything, this is made for Windows 7 and doesn't require support for 8.

    :dontgetit::thinking:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,771
    7,713
    210
    #704 Carlos Detweiller, Jun 27, 2013
    Last edited by a moderator: Apr 20, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    #705 Humphrey, Jun 27, 2013
    Last edited by a moderator: Apr 20, 2017
    The line I posted shows the full VER= line for me.

    Code:
     for /f "tokens=2,3,4 delims= " %a in ('wmic os get caption') do set ver=%c
    For "Home Premium" and "Home Basic" It may only show ver=home so just need to add this "ver=%c %d" I think.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,093
    24,397
    340
    #706 s1ave77, Jun 27, 2013
    Last edited by a moderator: Apr 20, 2017
    Nope, the "#" symbol is only to check there are no spaces in %ver%. In your case shows the correct output for Win 7 Ultimate.

    Using 'for'-loop in a single line makes no sense for me :eek:. Test the code snipplet from my earlier post.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,093
    24,397
    340
    #707 s1ave77, Jun 27, 2013
    Last edited by a moderator: Apr 20, 2017
    Here (Win 8 Pro WMC) it shows:
    Code:
    Microsoft Windows [Version 6.3.9431]
    (c) 2013 Microsoft Corporation. All rights reserved.
    
    C:\Windows\system32>for /f "tokens=2,3,4 delims= " %a in ('wmic os get caption')
     do set ver=%c
    
    C:\Windows\system32>set ver=
    
    C:\Windows\system32>set ver=Pro
    
    C:\Windows\system32>
     
    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
    and test my snippet in Home basic/premium to see what it says.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,093
    24,397
    340
    #709 s1ave77, Jun 27, 2013
    Last edited by a moderator: Apr 20, 2017
    Code:
    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    
    C:\Windows\system32>for /f "tokens=2,3,4 delims= " %a in ('wmic os get caption')
     do set ver=%c
    
    C:\Windows\system32>set ver=
    
    C:\Windows\system32>set ver=Home
    
    C:\Windows\system32>
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. 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...
  11. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    #711 Humphrey, Jun 27, 2013
    Last edited by a moderator: Apr 20, 2017
    Did you try adding that little bit extra I posted?


    for /f "tokens=2,3,4 delims= " %a in ('wmic os get caption') do set ver=%c %d
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,771
    7,713
    210
    #712 Carlos Detweiller, Jun 27, 2013
    Last edited by a moderator: Apr 20, 2017
    Code:
    76 65 72 3D 57 69 6E 64 6F 77 73 20 37 20 48 6F 6D 65 20 42 61 73 69 63 20 0D 20
    That's the Home Basic string, with 0x20 0x0D 0x20 at the end.

    I will, but I forgot to cut the network for the VMs, only for them deciding to install 100+ Windows updates.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    Oh no, damn VMware tools is messed up again.... Time to reinstall...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,093
    24,397
    340
    'wmic os get caption' can contain 6 words max so far i tested, e.g. 'Windows 8 Pro with Media Center'. First value is not needed, so it starts from 2 to 7. The loop afterwards cuts off any empty space in case only 4 words are used, e.g. 'Windows 7 Home Basic'.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. Humphrey

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    #715 Humphrey, Jun 27, 2013
    Last edited by a moderator: Apr 20, 2017
    Well if this is a version check, and you want the FULL line of 'Windows 7 "Edition here"' then okay, have it your way-but I say its not needed cause the batch file checks to see if your running windows 7 already. But I also will say that I haven't tested this on any OS other then my current OS (none-vm) so I do not know.

    Code:
    REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentVersion | FINDSTR 6.1 >NUL
    IF %ERRORLEVEL% NEQ 0 CLS & echo Supports only windows 7 and server 2008 R2 & ping -n 5 127.0.0.1 >nul & goto mainmenu 
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. s1ave77

    s1ave77 Has left at his own request

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

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    I stand corrected on my previous post. I test my code in Home Premium and only got it to show "HOME %D" which I am sure I could get it to work right but oh well..

    Post/Upload to DB the rearm script so that I can use in a VM please.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. s1ave77

    s1ave77 Has left at his own request

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

    Humphrey MDL Expert

    Dec 13, 2011
    1,455
    989
    60
    I already have ver 3 of check.bat test. I need the rearm script that you using to for into notifications mode. If you still have/use it.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  20. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,093
    24,397
    340
    #720 s1ave77, Jun 27, 2013
    Last edited by a moderator: Apr 20, 2017
    Ahhh...you may mean such one
    Code:
    @echo off
    CLS
    mode con: cols=50 lines=12
    >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
    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" )
    
    setlocal ENABLEDELAYEDEXPANSION
    
    
    :RearmIR6
    mode con: cols=62 lines=7
    CLS
    echo ...Rearming :)
    cscript.exe /b %windir%\system32\slmgr.vbs /rearm
    net stop sppsvc >NUL
    net start sppsvc >NUL
    
    cscript.exe /b %windir%\system32\slmgr.vbs /rearm
    net stop sppsvc >NUL
    net start sppsvc >NUL
    
    cscript.exe /b %windir%\system32\slmgr.vbs /rearm
    net stop sppsvc >NUL
    net start sppsvc >NUL
    
    cscript.exe /b %windir%\system32\slmgr.vbs /rearm
    net stop sppsvc >NUL
    net start sppsvc >NUL
    
    cscript.exe /b %windir%\system32\slmgr.vbs /rearm
    net stop sppsvc >NUL
    net start sppsvc >NUL
    
    slmgr /dlv
    
    ENDLOCAL
    exit
    
    
    You still need to forward time afterwards.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...