Windows Tweaking Scripts

Discussion in 'Scripting' started by mdl052020, Jul 29, 2020.

?

Do you like these batch scripts?

This poll will close on Jul 29, 2021 at 10:50.
  1. Yes

    147 vote(s)
    80.3%
  2. No

    9 vote(s)
    4.9%
  3. Will Decide After I Try Any of Script

    29 vote(s)
    15.8%
Multiple votes are allowed.
  1. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,046
    1,140
    60
    Please share your views if they are negative too . please feel free to share . i am always happy to know my loose points in scripts if theres any n suggestion by friends is always awesome cuz they tried to solve them at there end n will revert as a comment to my thread saying he dont like tjat function of that script whixh must be like that.
    i am so much happy with all friends comments on my thread :)
     
  2. ianymaty

    ianymaty MDL Member

    Jan 31, 2010
    128
    91
    10
    Sure, that is the purpose of the sharing, to improve the thing.
    Negative? In what way? If I don't like this or that, I won't say it like that: I don't like it! I won't use it as it not suits me or my purpose, that is my thinking.
    Maybe I'll suggest things to be added or improve things but not forceing it to be implemented if you don't feel it fits there.
    If something goes bad after the user modiffy what you share, what is your guilt?
    If they want to achieve something with your work and don't know how, they should ask before to make any changes not after they botched the thing.
     
  3. drew84

    drew84 MDL Addicted

    Mar 13, 2014
    956
    1,490
    30
    ... exactly
     
  4. wilenty

    wilenty MDL Member

    Jan 15, 2014
    218
    394
    10
    I have started checking yours script (Tweaker), because I noticed many problems with it in the latest posts.
    And by the way I checked most comments here from where the problem comes.

    If someone uses your work to get money, I propose you to write in the first post with big red letters something like I did: "This program can be freely shared on forums / websites / file hostings, but only in cases in which there's no profit (even from ads)." You can modify my text for you own needs. :)
    Generally "I glued myself" to the Freeware license, because when I shared the source of my work(s), some people(s) gets it then changes my nickname to himself and then share. It's a bit irritating... You invest your time to find solution for this and for that, but someone gets it changes nickname, because he can... Some of them even don't cares about my request, when I asked to no re-share my works on other file hostings (for some reason), when I had my own website... But, the re-shared links had more downloads than my own website...
    So, what you are expecting from people/users? That you wrote your request in big public forum to not re-share it and/or not use it in company? For sure they agreed with it...

    Come back to the script. First problem I have found is that you used static ".wim" extension for install image, because it can be "wim" or "esd". So, if any problems appears, ask them about the extension of install image. And you extracting all found ".iso" images from the ISO location to the DVD location - there can be a mess. ;-)

    Now, I come back to go through whole script step by step. :)
     
  5. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,046
    1,140
    60
    #405 mdl052020, Jun 28, 2021
    Last edited: Jun 28, 2021
    (OP)
    Awesome Brother Pl continue with your suggestion's i am learning from you . Pl keep it up.
    Thats so great of you for teaching me about the workaround i have to do in my scripts.
    I love the way you are trying very hard from your so much precious time to suggest me about the mistakes i have in my script project in a very firm way.

    1. Its a Popup msg shown at very first step that script only allow wim based iso to be tweaked & if script requirements shown as popup doesnt met then user can close it directly & execute it after all the requirements are pre met .

    Thanks a lot lot to you.
    Credits always yours n pleasure always mine.
     
  6. wilenty

    wilenty MDL Member

    Jan 15, 2014
    218
    394
    10
    Yes, but you reads all messages you see on the screen? Maybe only you, most people just "strikes [enter]". ;)

    I already found a method to work with the "esd" too, so, I disabled that message at all. :D
     
  7. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,046
    1,140
    60
    Its a great idea to forcefully show the popup till 10 minutes & theres no way for user to exit it via pressing any key on there keyboard.
    i will work on it whenever i will be free from some 《 ?s¿ both side up n down 》 from my dept.
     
  8. drew84

    drew84 MDL Addicted

    Mar 13, 2014
    956
    1,490
    30
    #408 drew84, Jul 2, 2021
    Last edited: Jul 9, 2021 at 10:39
    Started this little project (derived from @mdl052020's Win11 Tweaker)

    ------- Windows_11_SB_TPM_Modifier -------

    as an alternative to Win_11_Boot_And_Upgrade_FiX_KiT_v1.7

    Mostly because mdl052020's solution seems to be more complete in its application (places fix in more locations)
    --- seems to fall in line with this manual solution ---

    modified his stuff leaving only applicable code and added the Appraiserress_DLL section (for in-place upgrade purposes)

    the intention was to create a basically untouched ISO apart from the bypass application part

    Code whilst working is messy, needs cleaning up a bit? ... log output is all over the place (untidy)

    It is a work in progress, here is the link to what I am using so far


    See THIS POST for updated (and re-named) script

    Notes:
    1. Script is dependent on a couple of packages (included in the upload)
    2. The en-GB folder (contained in a sub-directory of Apply Image folder) was changed from original en-US
    3. Almost Forgot, PW = MDL2021
    4. Might be a good idea to grab this as well, OfflineInsiderEnroll

    Use:
    1. Place ISO to be Modified in ISO Folder
    2. Run Create Modified Windows 11 (Bypassing PC Requirements).cmd

    Members that need thanking (and are thanked): @mdl052020, @Enthousiast, @murphy78 and @wilenty

    Uploaded with the kind permission of mdl052020
     
  9. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,046
    1,140
    60
    Awesome Brother . Thanks a lot . You are a Genius :)
     
  10. zbigniew59

    zbigniew59 MDL Member

    May 14, 2016
    130
    39
    10
    @ drew84 - I want to test it but with iso pl.
    Where should I get the pl-PL folder?
     
  11. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,046
    1,140
    60
    Brother are you also a tester in Field / Stream / Platform .
    Thats so nice to have all testers in one place . Great Going .
     
  12. drew84

    drew84 MDL Addicted

    Mar 13, 2014
    956
    1,490
    30
    ... do as I did, rename the folder to pl-PL
    not even sure it was necessary (in my case) to change it from en-US.... just did it for cosmetic purposes

    you might also want to add your recent offering ("BypassStorageCheck" = dword: 00000001) to the script before running
     
  13. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,046
    1,140
    60
    Brother winrecfg mui is extracted by myself from adk 22000.1 pe en-us iso.
    i think pl-pl adk extraction of same mui plus its adjacent winrecfg must be pasted n overwritten with those two winrecfg files but not sure.

    Credits Goes to the great Xinso Master & Pleasure is always mine.
     
  14. drew84

    drew84 MDL Addicted

    Mar 13, 2014
    956
    1,490
    30
    #414 drew84, Jul 3, 2021 at 12:56
    Last edited: Jul 9, 2021 at 10:46
    For those of you (all 98 [26]) using this
    an updated script (ver. 1.2.0) for you

    See THIS POST for updated (and re-named) script

    Changelog:
    Code:
    1.2.0
    * Added Enable 'DEV' channel Feature
    
    * Some Minor Cosmetic Changes
    
    * Added @BAU's ToggleDefender.bat and @Enthousiast's Usage Instructions.gif to Notes folder
    
    1.1.0
    * Added Bypass Storage Check
    reg add "HKLM\OfflineSYSTEM\Setup\LabConfig" /v "BypassStorageCheck" /t REG_DWORD /d 1 /f
    
    * Some Minor Cosmetic Changes
    
     
  15. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,046
    1,140
    60
    Again Awesome Job Brother . Thanks a lot lot :)
     
  16. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,046
    1,140
    60
    Working on Something New to be Shared on new thread completely different from my previous script tools.
    If Decision become all Positive then Thread will be created on same Scripting Subforum.
    Example MDL AIO Windows 7 , 8 ,10 ,11 UEFI Based PE Creation Tool Without any Extra Third Party Tools but only Chrome is there for Internet access.
    PE Bakery is Mandatory to be used in that script tool.
     
  17. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,046
    1,140
    60
    #417 mdl052020, Jul 4, 2021 at 14:33
    Last edited: Jul 6, 2021 at 14:15
    (OP)
    Win7 ISO Updater via SIMPLIX Update Pack 7R2 With Drivers - Only UEFI BIOS Supported With X64 Arch Win7 SP1 ISO as Source as well X64 Win10 ISO as Source Too :

    Code:
    https://anonfiles.com/Xe854e48u5/Win-7ISO-Updater_zip
    
    Pl Put Simplix Update Pack Along With Addons to EXE directory.
    Put Win7 With SP1 ISO to Win7 Directory Under ISO & Win10 ISO to Win10 Directory Under ISO.
    Execute the SIMPLIX Script with Admin Privileges.
    There You Are Done with Updated Win7 ISO at Root of Project Directory ie Win-7ISO-Updater/ISO Name with Your Choice.
    Host OS used Must be Only Win10 1904x.xxxx

    Code:
    @echo off
    Set Ver=: 2021 Edition Version 1.0 :
    set Dism="%SystemRoot%\System32\Dism.exe"
    set Powershell="%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe"
    color 17
    title Windows7 ISO Updater %Ver% by MyDigitallife Member
    echo *****************************************************************
    echo ------------------- Ensure Admin Privileges ---------------------
    echo *****************************************************************
    REM  --> Check for permissions
    >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
    REM --> If error flag set, we do not have admin.
    if '%errorlevel%' NEQ '0' (    echo Requesting administrative privileges...    goto UACPrompt) else ( goto gotAdmin )
    :UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
    "%temp%\getadmin.vbs"
    exit /B
    :gotAdmin
    echo:                  Got Administrator Privilege
    echo *****************************************************************
    echo.
    echo *****************************************************************
    echo --- Extract ISO to Script Path and Create Mount Directory
    echo *****************************************************************
    pushd "%CD%"
    CD /D "%~dp0"
    IF NOT EXIST "Mount" md "Mount"
    IF NOT EXIST "DVD" md "DVD"
    IF NOT EXIST "DVD\Win7" md "DVD\Win7"
    IF NOT EXIST "DVD\Win10" md "DVD\Win10"
    Bin\7z.exe x -y -o"DVD\Win7" "ISO\Win7\*.iso"
    Bin\7z.exe x -y -o"DVD\Win10" "ISO\Win10\*.iso"
    echo *****************************************************************
    echo.
    echo *****************************************************************
    echo --- Export Single WIM Index of Your Choice to Script Path
    echo *****************************************************************
    SET /A count=0
    FOR /F "tokens=2 delims=: " %%i IN ('DISM /Get-WimInfo /WimFile:"DVD\Win7\sources\install.wim" ^| findstr "Index"') DO SET images=%%i
    FOR /L %%i in (1, 1, %images%) DO CALL :CountIndex %%i
    echo. Wim Image contain following %images% indexes :
    echo.
    FOR /L %%i in (1, 1, %images%) DO (
    echo.  [%%i] !name%%i!
    )
    GOTO ExportIndex
    echo *****************************************************************
    :MOVE
    echo *****************************************************************
    echo --- Move Back Exported WIM Image to its Source Path
    echo *****************************************************************
    move /y "install.wim" "DVD\Win7\sources\install.wim"
    echo *****************************************************************
    echo.
    echo *****************************************************************
    echo --- Update Win7 Selected Image Index with SiMPLiX Update Pack
    echo *****************************************************************
    "%~dp0EXE\UpdatePack7R2.exe" /WimFile="%~dp0DVD\Win7\sources\install.wim" /Index=* /ie11 /FixOn /NVMe /Optimize
    echo *****************************************************************
    Pause
    echo.
    echo *****************************************************************
    echo --- Mounting Selected WIM Image Index to Mount Directory
    echo *****************************************************************
    Powershell -Command "Mount-WindowsImage -ImagePath 'DVD\Win7\sources\install.wim' -Index 1 -Path 'Mount' -Verbose"
    echo *****************************************************************
    echo.
    echo *****************************************************************
    echo --- Integrate Essential Drivers Into Install Wim
    echo *****************************************************************
    Dism /image:"Mount" /Add-Driver /driver:"Drivers\(W)LAN_7_x64" /recurse
    Dism /image:"Mount" /Add-Driver /driver:"Drivers\nVME_7_x64" /recurse
    Dism /image:"Mount" /Add-Driver /driver:"Drivers\USB3x_7_x64" /recurse
    echo *****************************************************************
    echo.
    echo *****************************************************************
    echo --- Select and Disable UnNeeded Windows Features
    echo *****************************************************************
    Powershell -Command "Get-WindowsOptionalFeature -Path 'Mount' | Where-Object {$_.State -eq 'Enabled' } | Out-GridView -PassThru -Title 'Select Windows Optional Features to Disable' | Disable-WindowsOptionalFeature -Path 'Mount' -Verbose"
    echo *****************************************************************
    echo.
    echo *****************************************************************
    echo --- Saving and Unmounting Final Updated Image
    echo *****************************************************************
    Powershell -Command "Dismount-WindowsImage -Path 'Mount' -Save -CheckIntegrity -Verbose"
    echo *****************************************************************
    echo.
    echo *****************************************************************
    echo --- Export Wim Images to Compress Maximum
    echo *****************************************************************
    Dism /Export-Image /SourceImageFile:"DVD\Win10\sources\boot.wim" /ALL /DestinationImageFile:"boot.wim" /Compress:max /CheckIntegrity
    move /y "boot.wim" "DVD\Win10\sources\boot.wim"
    Dism /Export-Image /SourceImageFile:"DVD\Win7\sources\install.wim" /ALL /DestinationImageFile:"install.wim" /Compress:max /CheckIntegrity
    move /y "install.wim" "DVD\Win10\sources\install.wim"
    echo.
    IF EXIST "DVD\Win7" rd /s /q "DVD\Win7"
    echo *****************************************************************
    echo.
    echo *****************************************************************
    echo --- Reduce ISO Layout to Maximum Extent
    echo *****************************************************************
    setlocal EnableExtensions DisableDelayedExpansion
    set "TargetFolder=.\DVD\Win10\sources"
    set "ExcludeFiles="
    for %%I in ("%TargetFolder%\") do if "%%~dpI" == "%~dp0" set "ExcludeFiles=/C:"%~nx0""
    for /F "eol=| delims=" %%I in ('dir "%TargetFolder%\" /AD /B 2^>nul ^| %SystemRoot%\System32\findstr.exe /I /L /V /X /C:".\*"') do rd /S /Q "%TargetFolder%\%%I"
    for /F "eol=| delims=" %%I in ('dir "%TargetFolder%\" /A-D /B 2^>nul ^| %SystemRoot%\System32\findstr.exe /I /L /V /X /C:"boot.wim" /C:"install.wim" /C:"lang.ini" /C:"setup.exe" %ExcludeFiles%') do del /A /F "%TargetFolder%\%%I"
    endlocal
    setlocal EnableExtensions DisableDelayedExpansion
    set "TargetFolder=.\DVD\Win10"
    set "ExcludeFiles="
    for %%I in ("%TargetFolder%\") do if "%%~dpI" == "%~dp0" set "ExcludeFiles=/C:"%~nx0""
    for /F "eol=| delims=" %%I in ('dir "%TargetFolder%\" /AD /B 2^>nul ^| %SystemRoot%\System32\findstr.exe /I /L /V /X /C:"boot" /C:"efi" /C:"sources"') do rd /S /Q "%TargetFolder%\%%I"
    for /F "eol=| delims=" %%I in ('dir "%TargetFolder%\" /A-D /B 2^>nul ^| %SystemRoot%\System32\findstr.exe /I /L /V /X /C:"bootmgr" /C:"bootmgr.efi" %ExcludeFiles%') do del /A /F "%TargetFolder%\%%I"
    endlocal
    echo --- Reduced Win10 ISO Layout to Maximum Extent
    echo.
    IF EXIST "DVD\Win10" ren "DVD\Win7"
    echo *****************************************************************
    echo.
    echo *****************************************************************
    echo --- Create Final Windows Tweaked ISO
    echo *****************************************************************
    set /p ISOFileName=Enter ISO Filename :
    "Bin\oscdimg.exe" -bootdata:2#p0,e,b".\DVD\Win7\boot\etfsboot.com"#pEF,e,b".\DVD\Win7\efi\microsoft\boot\efisys.bin" -o -h -m -u2 -udfver102 -lGSP1RMCULXFRER_EN_DVD ".\DVD\Win7" "%~dp0%ISOFileName%.iso"
    echo *****************************************************************
    echo.
    echo *****************************************************************
    echo --- Remove Extra Files of Project %Ver%
    echo *****************************************************************
    pushd "%CD%"
    CD /D "%~dp0"
    Dism /Cleanup-Mountpoints
    Powershell -Command "Clear-WindowsCorruptMountPoint"
    IF EXIST "Mount" rd /s /q "Mount"
    IF EXIST "DVD" rd /s /q "DVD"
    echo *****************************************************************
    echo Tweaker Script %Ver% Completed at %DATE% %TIME%
    echo *****************************************************************
    echo **************************** The End ****************************
    Powershell -Command "$wshell=New-Object -ComObject wscript.shell; $wshell.SendKeys('^a')
    Powershell -Command "$wshell=New-Object -ComObject wscript.shell; $wshell.SendKeys('^c')
    Powershell -Command "Get-Clipboard >SiMPLiX.LOG"
    color 02
    pause
    exit /b
    
    :ExportIndex
    echo.
    SET /P INDEXCHOICE=Select Single Image Index Number You Want to Export and Tweak :
    DISM /Export-Image /SourceImageFile:"DVD\sources\install.wim" /Sourceindex:%INDEXCHOICE% /DestinationImageFile:"%~dp0\install.wim" /CheckIntegrity
    echo *****************************************************************
    echo.
    GOTO MOVE
    
    :CountIndex
    SET /A count+=1
    FOR /f "tokens=1* delims=: " %%i IN ('DISM /Get-WimInfo /wimfile:"DVD\sources\install.wim" /index:%1 ^| find /i "Name"') DO SET name%count%=%%j
    
    
     
  18. maargueb

    maargueb MDL Junior Member

    Jun 9, 2019
    96
    9
    0
    I used the script, Windows became very fast, thank you
     
  19. mdl052020

    mdl052020 MDL Member

    May 31, 2020
    1,046
    1,140
    60
    #419 mdl052020, Jul 7, 2021 at 17:17
    Last edited: Jul 7, 2021 at 17:33
    (OP)
    Most Welcome But Most of People Say that its a Piece of S**t i am doing. It makes there OS Unstable.
    For Me :
    I always used my own created Script Tools & still is using on the OS from which i am posting this comment . its going flwalessly more faster then win7 we expereince in terms of speeds as well as anything else we need for our work. idk what others experience about my script tool if they dont know how to use anything.
    Now they will say self promotion . thatswhy i have stopped everything on MDl & become a Silent watcher since some days & its going great as i am watching the drama of most of users.
    I realized that i was waisting my time to make everything very easy for anybody else using M$ OS for daily computing or for Fresh new Installation of Win10 but i was wrong as i am doing it for wrong people who doesnt deserve some good work.
     
  20. vlackrs

    vlackrs MDL Novice

    Jan 13, 2013
    13
    4
    0
    #420 vlackrs, Jul 8, 2021 at 06:34
    Last edited: Jul 8, 2021 at 06:48
    Hi, i just have to make a file with your code in notepad and what kind of extension?

    edit: or better, how do i use your code to not have problems?

    edit2: is compatible with win10 1909?