1. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,732
    313
    60
    HUGE THANKS to MSMG for his Toolkit. I stopped SFC and DISM craze and got me that LTSB super-slim version, using all 3 - MSMG Toolkit, DISM++, and the free version of NTLite. I finally COMPLETELY free of whatever they did to FullScreen Exclusive mode that prevented playback of videos at 23.976p with MPC-HC, LAV Filters, madVR, and ReClock. No matter what you do or settings you use or DLL's you remove Creator's Update majorly messes with video, be it playback or games. All issues finally GONE now. I can't believe MS actually releases these updates as TEST versions for us non-corporate folks to "explore with enthusiast".
     
  2. biatche

    biatche MDL Addicted

    Nov 14, 2009
    573
    144
    30
    how do you do that?
     
  3. GodHand

    GodHand MDL Addicted

    Jul 15, 2016
    534
    926
    30
    C++, C#, Ruby and Python all have workable scripts utilizing the API, and they're all over the web. I'm not sure how me posting an example C++/C#/Python script will make you understand in regards to how the API works.

    For something simple, like displaying a list of packages available in an image in a C# script, the API.dll needs imported into the script: [DllImport("DismApi.dll")]

    Then use the public static extern method to call the global scope variable "DismGetPackages," which points to the Session integer (DismOpenSession) and then, to sum it up, display packages and detailed information about each package - int DismGetPackages(uint Session, out uint PackageCount).

    So there's a very simple line of C# code on using the API to point to the open session of the mounted image and display all packages installed in the image as well as detailed information on each package.

    Or use C++ (one of the easist of the coding languages, imo, next to Ruby) to apply an unattend.xml to an offline image

    }
    hr = DismApplyUnattend(session,
    L:"C\\unattend.xml",
    FALSE);
    if (FAILED(hr))
    {
    wprintf(L"DismApplyUnattend Failed: %x\n", hr);
    goto Cleanup;
    }

    Or mount a VHD of an install image we plan to migrate to a live OS:

    hr = DismMountImage(L"C:\\Install.VHD",
    L"C:\\VHDMount",
    1,
    NULL,
    DismImageIndex,
    DISM_MOUNT_READWRITE,
    NULL,
    NULL);
    if (FAILED(hr))
    {
    wprintf(L"DismMountImage Failed: %x\n", hr);
    goto Cleanup;
    }

    These are just a few very rudimentary examples of what your typical C# or C++ code would look like.

    I recommend searching for a solid wrapper, though, if you want to invest time in using the API to accommodate yourself with it, its functions and abilities, and then dive into creating your personal scripts. Using a wrapper is good for beginners and will let you get a handle on what exactly the API can do.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Windows 10 User

    Windows 10 User MDL Guru

    Feb 2, 2017
    2,005
    122
    90
    So, for some reason my DVD drive doesn't have the D letter (it has the E letter instead) and I have a default0 folder in the users folder every time I install Windows after using this tool.
     
  5. MSMG

    MSMG MDL Developer

    Jul 15, 2011
    6,414
    15,608
    210
    Installing Windows by booting from a USB drive does changes the drive letter and this has been since W8.1, the USB drive uses the D: drive letter and so the actual D: drive letter is shifted to E:

    I myself have faced this problem and I do change drive letter order manual and this has nothing to do with the ToolKit.


    The default0 user folder is not in the image but it's created while the windows setup creates the users and again this has nothing to do with the ToolKit coz I have tested myself and there's no default0 folder in any of the installation I have done.

    There's been a script to auto delete this default0 which was discussed few weeks back here, checkout the previous posts.

     
  6. dhjohns

    dhjohns MDL Guru

    Sep 5, 2013
    3,262
    1,733
    120
    You could spend all day. I don't know if it is the same one, but it works well.
    SET UserToRemove="defaultuser0"
    REM 'CALL' check registry subroutine check for existance and remove.
    FOR /f "tokens=*" %%a IN ('REG query "HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList"^|find /i "s-1-5-21"') DO CALL :ChkRegistry "%%a"
    GOTO :Finish

    :ChkRegistry
    REM -----------------------------------------------------------------------
    REM Results of ERRORLEVEL are:
    REM 0 -- If UserToRemove is found in the registry then run rest of script.
    REM 1 -- If UserToRemove is NOT found in the registry then exit script.
    REM -----------------------------------------------------------------------
    FOR /f "tokens=3" %%g in ('reg query %1 /v ProfileImagePath') DO SET UserProfilePath=%%g
    FOR /f "tokens=3 delims=\" %%e in ('echo %UserProfilePath%') DO SET ProfileName=%%e
    FOR /f "tokens=1 delims=." %%f IN ('echo %ProfileName%') DO SET ParseRegistry=%%f
    ECHO %UserToRemove%|find /I "%ParseRegistry%" > NUL
    IF ERRORLEVEL=1 GOTO :Finish

    REM Remove that user...
    RMDIR "%SystemDrive%\Users\%ProfileName%" /s /q
    REG delete %1 /f >nul
    IF EXIST "%SystemDrive%\Users\%ProfileName%" GOTO :RetryDirRemove
    GOTO :Finish

    :RetryDirRemove
    TAKEOWN /F "%ProfileName%" >nul
    TIMEOUT /T 2 >nul
    ICACLS "%ProfileName%" /GRANT *S-1-1-0:F >nul
    TIMEOUT /T 2 >nul
    RMDIR "%SystemDrive%\Users\%ProfileName%" /s /q

    :Finish
    REM End of script...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Windows 10 User

    Windows 10 User MDL Guru

    Feb 2, 2017
    2,005
    122
    90
    Strange. I installed an untouched Windows 10 many times and I didn't have those problems. And how can I remove those live tiles so when I install Windows 10 I don't have them? Why does that happen after installing Windows from a USB drive, why is the default0 folder created and if I don't change the E letter to D will I have problems with the DVD drive?
     
  8. cunuhoujabsq

    cunuhoujabsq MDL Novice

    Jan 30, 2015
    15
    5
    0
    delete defaultuser0
    copy the folder from the archive \sources
    -1.jpg
     

    Attached Files:

  9. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,679
    103,521
    450
    #2809 Enthousiast, May 26, 2017
    Last edited: May 26, 2017
    Looks like the script mxman2k uses in his MRP?

    @MSMG, the defaultuser0 is present in all standard installs.

    It has been since at least 14393 and still present on 16199 (just check all posted logs in the MRP thread or here: https://forums.mydigitallife.net/th...-refresh-pc-mobile.70297/page-50#post-1252228).
     
  10. Super Spartan

    Super Spartan MDL Expert

    May 30, 2014
    1,738
    1,009
    60
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,679
    103,521
    450
    The keyword = standard install ;)
     
  12. AeonX

    AeonX MDL Addicted

    May 24, 2013
    796
    725
    30
    #2812 AeonX, May 26, 2017
    Last edited: May 26, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. Supern00b

    Supern00b MDL Addicted

    Dec 30, 2010
    762
    556
    30
    On a side note, you can have both x86 and x64 answer files in one single xml.

    Cheers.
     
  14. AeonX

    AeonX MDL Addicted

    May 24, 2013
    796
    725
    30
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. Ace2

    Ace2 MDL Expert

    Oct 10, 2014
    1,863
    1,524
    60
    #2816 Ace2, May 26, 2017
    Last edited: May 27, 2017
    Windows10 Professional x64 (15063).
    Code:
    [1].Mount install.wim with ToolKit-v7.3
    
    [2].Add-Packages
    Dism /Image:C:\ToolKit-v7.3\Mount\Install /Add-Package /PackagePath:C:\Microsoft-Windows-NetFx3-OnDemand-Package.cab
    Dism /Image:C:\ToolKit-v7.3\Mount\Install /Add-Package /PackagePath:C:\Windows10.0-KB4016871-x64.cab
    Dism /Image:C:\ToolKit-v7.3\Mount\Install /Add-Package /PackagePath:C:\Windows10.0-KB4020102-x64.cab
    
    [3].Disable-Features
    WCF Services
    Dism /Image:C:\ToolKit-v7.3\Mount\Install /disable-feature /featurename:WCF-Services45
    
    Media Features
    Dism /Image:C:\ToolKit-v7.3\Mount\Install /disable-feature /featurename:MediaPlayback
    
    Microsoft Print to PDF
    Dism /Image:C:\ToolKit-v7.3\Mount\Install /disable-feature /featurename:Printing-PrintToPDFServices-Features
    
    Print and Document Services
    Dism /Image:C:\ToolKit-v7.3\Mount\Install /disable-feature /featurename:Printing-Foundation-Features
    
    Remote Differential Compression API Support
    Dism /Image:C:\ToolKit-v7.3\Mount\Install /disable-feature /featurename:MSRDC-Infrastructure
    
    SMB 1.0/CIFS File Sharing Support
    Dism /Image:C:\ToolKit-v7.3\Mount\Install /disable-feature /featurename:SMB1Protocol
    
    Windows PowerShell 2.0
    Dism /Image:C:\ToolKit-v7.3\Mount\Install /disable-feature /featurename:MicrosoftWindowsPowerShellV2Root
    
    Work Folders Client
    Dism /Image:C:\ToolKit-v7.3\Mount\Install /disable-feature /featurename:WorkFolders-Client
    
    XPS Services
    Dism /Image:C:\ToolKit-v7.3\Mount\Install /disable-feature /featurename:Printing-XPSServices-Features
    
    XPS Viewers
    Dism /Image:C:\ToolKit-v7.3\Mount\Install /disable-feature /featurename:Xps-Foundation-Xps-Viewer
    
    Search
    Dism /Image:C:\ToolKit-v7.3\Mount\Install /disable-feature /featurename:SearchEngine-Client-Package
    
    [4].Enable-Feature
    Legacy Components
    Dism /Image:C:\ToolKit-v7.3\Mount\Install /enable-feature /featurename:LegacyComponents
    Dism /Image:C:\ToolKit-v7.3\Mount\Install /enable-feature /featurename:DirectPlay
    
    [5].Remove all with ToolKit-v7.3
    4 - 1 - 2
    4 - 1 - 3
    4 - 2
    4 - 3 - 1
    4 - 3 - 2 - 1
    4 - 3 - 2 - 2
    4 - 3 - 2 - 3
    4 - 3 - 2 - 4
    4 - 3 - 2 - 5
    4 - 3 - 2 - 6
    4 - 3 - 2 - 7
    4 - 3 - 2 - 8
    4 - 3 - 2 - 9
    
    [6].Save image with ToolKit-v7.3
    6 - 3
    OR
    6 - 1

    NOTES:
    I was unable to just add Microsoft-Windows-NetFx3-OnDemand-Package.cab and Windows10.0-KB4020102-x64.cab to an untouched install.wim, (Exported from install.esd, download with media creation tool), Windows10.0-KB4020102-x64.cab would fail at the end with an unattend.xml file error.

    Microsoft-Windows-NetFx3-OnDemand-Package.cab and Windows10.0-KB4016871-x64.cab and Windows10.0-KB4020102-x64.cab work fine together. ;)
     
  16. MSMG

    MSMG MDL Developer

    Jul 15, 2011
    6,414
    15,608
    210
  17. BearPaws

    BearPaws MDL Novice

    Nov 14, 2008
    45
    26
    0
    Hi MSMG, I was going for number 2 "Integrate to Windows Installation Image" and eventually integrate to Windows Setup Boot Image as well. Thank you
     
  18. °ツ

    °ツ MDL Addicted

    Jun 8, 2014
    903
    1,178
    30