Multi-OEM/Retail Project {MRP} - Mk3

Discussion in 'MDL Projects and Applications' started by mxman2k, Oct 15, 2016.

  1. b01m

    b01m MDL Novice

    Nov 14, 2017
    27
    25
    0
    [CHKMN] Computer Model Name: Undefined.

    maybe from bios mod
     
  2. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,320
    21,061
    210
    That is possible yes. As the MRP cannot read the bios area. it may have some corrupted characters and so the MRP classes it as undefined. You can use the option in the config creator to set the model name to whatever you wish.

    The model name is not always the same as what is shown on the summary part near the top of the log, as the MRP looks at another area in the DMI/Bios. Where normally the actual model name resides.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. b01m

    b01m MDL Novice

    Nov 14, 2017
    27
    25
    0
    Yup, usually I also use MRP Config Creator
    but not a big deal for me :D
     
  4. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,320
    21,061
    210
    Its only a cosmetic thing :p

    The important bit is that it brands, in the case of vista/7/servers that it activates too. W8.x/10 obviously are done 'online' to the m$ servers for their activation.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. JanCerny

    JanCerny MDL Senior Member

    Sep 13, 2012
    295
    194
    10
  6. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,320
    21,061
    210
    The turn off fastboot option was one i was thinking of adding :)

    Driversearching i think there are other Reg tweaks for this area too that is needed as that alone can get bypassed. Will investigate what tweaks i use on my own installs and see what else maybe is needed.

    For now those two can be added to the oobe.cmd as they are Local Machine reg tweaks. For non W8.x/10 the fastboot one would be ignored and not affect other OS's. :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,679
    103,527
    450
    "Take Ownership with pause", would also be a nice one :)
     
  8. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,320
    21,061
    210
    Just adding the Fastboot/DriverSearching options in the config creator. :)

    If you have the code needed for the TakeOwnership w/pause, i have one without the pause.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,679
    103,527
    450
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\*\shell\TakeOwnership]
    @="Take Ownership"
    "HasLUAShield"=""
    "NoWorkingDirectory"=""
    "Position"="middle"
    
    [HKEY_CLASSES_ROOT\*\shell\TakeOwnership\command]
    @="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%1\\\" && icacls \\\"%1\\\" /grant *S-1-3-4:F /c /l & pause' -Verb runAs\""
    "IsolatedCommand"= "powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%1\\\" && icacls \\\"%1\\\" /grant *S-1-3-4:F /c /l & pause' -Verb runAs\""
    
    [HKEY_CLASSES_ROOT\Directory\shell\TakeOwnership]
    @="Take Ownership"
    "AppliesTo"="NOT (System.ItemPathDisplay:=\"C:\\Users\" OR System.ItemPathDisplay:=\"C:\\ProgramData\" OR System.ItemPathDisplay:=\"C:\\Windows\" OR System.ItemPathDisplay:=\"C:\\Windows\\System32\" OR System.ItemPathDisplay:=\"C:\\Program Files\" OR System.ItemPathDisplay:=\"C:\\Program Files (x86)\")"
    "HasLUAShield"=""
    "NoWorkingDirectory"=""
    "Position"="middle"
    
    [HKEY_CLASSES_ROOT\Directory\shell\TakeOwnership\command]
    @="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%1\\\" /r /d y && icacls \\\"%1\\\" /grant *S-1-3-4:F /c /l /q & pause' -Verb runAs\""
    "IsolatedCommand"="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%1\\\" /r /d y && icacls \\\"%1\\\" /grant *S-1-3-4:F /c /l /q & pause' -Verb runAs\""
    
    
    I believe i used this one on 10, don't know if it also works on 7/8.
     
  10. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,320
    21,061
    210
    hmmm get an error when converting to cmd using REG... :g:
    Code:
    :: ---------------------------------------------------  !!! Incorrect Data Found !!!  -------------------------------------------------------------
    :: HKEY_CLASSES_ROOT\*\shell\TakeOwnership\command --> IsolatedCommand"= "powershell -windowstyle hidden -command "Start-Process cmd -ArgumentList '/c takeown /f \"%1\" && icacls \"%1\" /grant *S-1-3-4:F /c /l & pause' -Verb runAs"
    :: ------------------------------------------------------------------------------------------------------------------------------------------------
    
    Reg.exe add "HKCR\*\shell\TakeOwnership" /ve /t REG_SZ /d "Take Ownership" /f
    Reg.exe add "HKCR\*\shell\TakeOwnership" /v "HasLUAShield" /t REG_SZ /d "" /f
    Reg.exe add "HKCR\*\shell\TakeOwnership" /v "NoWorkingDirectory" /t REG_SZ /d "" /f
    Reg.exe add "HKCR\*\shell\TakeOwnership" /v "Position" /t REG_SZ /d "middle" /f
    Reg.exe add "HKCR\*\shell\TakeOwnership\command" /ve /t REG_SZ /d "powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%%1\\\" && icacls \\\"%%1\\\" /grant *S-1-3-4:F /c /l & pause' -Verb runAs\"" /f
    Reg.exe add "HKCR\Directory\shell\TakeOwnership" /ve /t REG_SZ /d "Take Ownership" /f
    Reg.exe add "HKCR\Directory\shell\TakeOwnership" /v "AppliesTo" /t REG_SZ /d "NOT (System.ItemPathDisplay:=\"C:\Users\" OR System.ItemPathDisplay:=\"C:\ProgramData\" OR System.ItemPathDisplay:=\"C:\Windows\" OR System.ItemPathDisplay:=\"C:\Windows\System32\" OR System.ItemPathDisplay:=\"C:\Program Files\" OR System.ItemPathDisplay:=\"C:\Program Files (x86)\")" /f
    Reg.exe add "HKCR\Directory\shell\TakeOwnership" /v "HasLUAShield" /t REG_SZ /d "" /f
    Reg.exe add "HKCR\Directory\shell\TakeOwnership" /v "NoWorkingDirectory" /t REG_SZ /d "" /f
    Reg.exe add "HKCR\Directory\shell\TakeOwnership" /v "Position" /t REG_SZ /d "middle" /f
    Reg.exe add "HKCR\Directory\shell\TakeOwnership\command" /ve /t REG_SZ /d "powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%%1\\\" /r /d y && icacls \\\"%%1\\\" /grant *S-1-3-4:F /c /l /q & pause' -Verb runAs\"" /f
    Reg.exe add "HKCR\Directory\shell\TakeOwnership\command" /v "IsolatedCommand" /t REG_SZ /d "powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%%1\\\" /r /d y && icacls \\\"%%1\\\" /grant *S-1-3-4:F /c /l /q & pause' -Verb runAs\"" /f
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,209
    90,791
    340
    #1992 abbodi1406, Dec 25, 2017
    Last edited: Dec 26, 2017
    Hi
    thanks for the great work

    since they enhanced DISM edition and licensing switch in WIP 17063, querying "Component Based Servicing" registry key seems the only method to detect the actual installed edition (which used for applicating updates)

    this simple script detect OS Edition from several sources
    Code:
    @ECHO OFF
    
    SET "INL=IF NOT ERRORLEVEL 1"
    
    SET "Key=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages"
    SET "Pattern=Microsoft-Windows-*Edition~31bf3856ad364e35"
    SET "EditionPKG=NUL"
    FOR /F "TOKENS=8 DELIMS=\" %%A IN ('REG QUERY "%Key%" /f "%Pattern%" /k 2^>NUL ^| FIND /I "CurrentVersion"') DO (
      REG QUERY "%Key%\%%A" /v "CurrentState" 2>NUL | FIND /I "0x70" 1>NUL && (
        FOR /F "TOKENS=3 DELIMS=-~" %%B IN ('ECHO %%A') DO SET "EditionPKG=%%B"
      )
    )
    IF /I "%EditionPKG:~-7%"=="Edition" SET "EditionCBS=%EditionPKG:~0,-7%"
    
    FOR /F "TOKENS=3 DELIMS=: " %%A IN ('DISM /English /Online /Get-CurrentEdition 2^>NUL ^| FIND /I "Current Edition :"') DO %INL% SET "EditionDISM=%%A"
    
    FOR /F "TOKENS=2 DELIMS==" %%A IN ('"WMIC PATH SoftwareLicensingProduct WHERE (Name LIKE 'Windows%%' AND PartialProductKey is not NULL) GET LicenseFamily /VALUE" 2^>NUL') DO %INL% SET "EditionWMIC=%%A"
    
    FOR /F "SKIP=2 TOKENS=3" %%A IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID 2^>NUL') DO %INL% SET "EditionREG=%%A"
    
    ECHO # OS Edition #
    IF DEFINED EditionCBS  ECHO CBS     : %EditionCBS%
    IF DEFINED EditionDISM ECHO DISM    : %EditionDISM%
    IF DEFINED EditionWMIC ECHO WMIC    : %EditionWMIC%
    IF DEFINED EditionREG  ECHO Registry: %EditionREG%
    ECHO.
    ECHO Press any key to exit.
    PAUSE >NUL
    EXIT
    CBS will always report the actual underlying installed edition (works for all Win7+ version)
    DISM also reports the same, up until 17063 change
    WMIC reports the edition that have installed product key
    Registry reports the usual EditionID value

    not to sound picky, but maybe the Query Tool can show the CBS edition info :)
    something like:
    Code:
    -------------------------------------------
     OS Version {WMIC}         - Microsoft Windows 10 Pro for Workstations Insider Preview x86
     OS Edition {Registry}     - ProfessionalWorkstation
     OS Edition {CBS}          - Professional
     OS Build Number           - 17063
     OS Update Build Revision  - 1000
    p.s.
    what this means? i get it on my real machine Windows 8.1
    Code:
    Your Boot drive may need checking as status returned: Warning.
    Regards.
     
  12. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,320
    21,061
    210
    Added the two options to the Creator GUI...

    FastBoot/DriverSearching

    Now the extra code to put into the saved file and then into MRP itself.

    This version of Creator/MRP will not be available until early January 2018. :p
     

    Attached Files:

    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,320
    21,061
    210
    #1994 mxman2k, Dec 25, 2017
    Last edited: Dec 25, 2017
    (OP)
    The wmic call used to determine the BusType (IDE/SATA etc) on Windows 8.x/10 also has the added return code for a HDD's health indicator, normally it is 0 (zero - OK/healthy), if it returns 1 or 2 then it means the drive may need a scandisk/diskcheck. It may be a false return code, i just used the flag and present the message.

    Code:
    HealthStatus
    Data type: UInt16
    Access type: Read-only
    The health status of the disk device.
    
    Value    Meaning
    Healthy
    0
    The disk is functioning normally.
    
    Warning
    1
    The disk is still functioning, but has detected errors or issues that require administrator intervention.
    
    Unhealthy
    2
    The volume is not functioning, due to errors or failures. The volume needs immediate attention from an administrator.
    

    The WMIC call used on the edition in the QT is i believe the same CBR result ? @s1ave77 can answer that better than me as he sorted that area out for me. :p


    The vbs used to query the bustype etc... (8.x/10)
    Code:
    ' Query Disks for bootdrive, SSD/HDD, Bustype etc
    
    On Error Resume Next
        Dim oWMI, Instances, Instance
        Set oWMI = GetObject("WINMGMTS:\\.\ROOT\Microsoft\Windows\Storage")
        Set Instances = oWMI.InstancesOf("MSFT_Disk", 1)
        Value1=0
     
        For Each Instance In Instances
        Value1 = instance.BootFromDisk
        IF Value1 = -1 then Value1 = "1" else Value1 = "0"
     
        WScript.Echo Value1 & "|" & instance.Number & "|" & instance.BusType & "|" & instance.HealthStatus & "|" & instance.PartitionStyle & "|" & instance.Model
        next
    The reason i have the Value1 do a change is because the BootFromDisk returns True/False but in localized language via the Wscript.echo, so i did a bit of a tweak to force it to return 1 (true) or 0 (false) for my purposes to indicate the booted system drive.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,320
    21,061
    210
    Code:
    # :DisableFastBoot - This Enables or Disables the Fast Boot within Windows.
    # This may help with sleep/wake issues.
    # Default No.
    
    :DisableFastBoot=Yes
    
    # #################################################################################################################################
    
    # :DisableDriverSearching - This Enables or Disables the Driver Searching within Windows.
    # This option turns off or on the Driver Searching used in Windows Update.
    # Default No.
    
    :DisableDriverSearching=Yes
    :)

    That's the easy part lol.

    MRP code is a bit more complex... Will start on that tomorrow.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,320
    21,061
    210
    That's one of my personal tweaks :p Also another that sets LAN to Metered. Just to slow down the updates :p
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,320
    21,061
    210
    #1998 mxman2k, Dec 25, 2017
    Last edited: Dec 26, 2017
    (OP)
    Code:
    # :DisableAutoWURestart - This enables or disables automatic restart after Windows Updates.
    # Set to Yes will prevent the auto restart.
    # Default is No.
    
    :DisableAutoWURestart=Yes
    If checkbox ticked sets to Yes ie prevent the auto reboot message etc.

    It's in the General Options area as it can be used on Windows 7 and above.

    With all options in the GUI if you hover your mouse pointer over them a little info-Tip will appear explaining what the option does. A nice little extra. :p
     

    Attached Files:

    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. mxman2k

    mxman2k MDL Developer

    Jun 20, 2007
    6,320
    21,061
    210
    @abbodi1406 I hope the QT Health message was a false one for your boot drive!

    If there is no faults/errors then i can disable that message in the next QT as only added it as it was available in the output vars.

    There is no other info about that flag, so it could mean a scandisk/defrag is needed, or in the case of a SSD a trim/optimize...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. galen2

    galen2 MDL Novice

    Nov 4, 2009
    2
    1
    0
    That was the problem, i used MSDN iso and without ei.cfg. I will use ei.cfg in the future. thank you.