abbodi1406's Batch Scripts Repo

Discussion in 'Scripting' started by abbodi1406, May 4, 2017.

  1. 正义羊

    正义羊 MDL Senior Member

    Feb 21, 2016
    258
    152
    10
    Yes. But it works some issue, so it's crash.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,679
    103,527
    450
    What ISOs did you feed it and what option did you try? Or does it not open at all?
    I have the habit to always rightclick and start cmd's as admin.
     
  3. 正义羊

    正义羊 MDL Senior Member

    Feb 21, 2016
    258
    152
    10
    It does not open at all.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Dark Dinosaur

    Dark Dinosaur X Æ A-12

    Feb 2, 2011
    4,162
    5,977
    150
    my best guess.
    Sandbox / Security app block the script.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,679
    103,527
    450
    Can you post the full path to the cmd?
     
  6. Paul Mercer

    Paul Mercer MDL Expert

    Apr 6, 2018
    1,942
    4,167
    60
    are you sure that script work without Admin rights?
    the last working version for me is the one in uup-converter-wimlib-78r

    short video - https://imgur.com/a/0nYbXW9
     
    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
    I didn't say it would work without admin rights, i said my habit is always to rightclick and use open as admin for cmd's.

    [​IMG]
     
  8. Paul Mercer

    Paul Mercer MDL Expert

    Apr 6, 2018
    1,942
    4,167
    60
    yeah, same behavior
    script is running only with Admin rights, and 78r version is working with simple double click
    p.s. sorry for my bad English
     
    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
    #1949 Enthousiast, May 28, 2022
    Last edited: May 28, 2022
    I guess the script is auto-elevated by convert-UUP.cmd when virtual editions is set by the ini/script?
     
  10. Paul Mercer

    Paul Mercer MDL Expert

    Apr 6, 2018
    1,942
    4,167
    60
    that's for create_virtual_editions.cmd
    multi_arch_iso.cmd is the extra standalone script I guess
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,679
    103,527
    450
    Yeah, i mix them up frequently:D
     
  12. 正义羊

    正义羊 MDL Senior Member

    Feb 21, 2016
    258
    152
    10
    "E:\uup-converter-wimlib-80_ZH-CN\multi_arch_iso.cmd"

    It used to work fine, until the 79f started, this script never worked again. The path has always been such a path.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,679
    103,527
    450
    Then you can safely use 79 pre f, the only difference with 80 will be that it now also combines isos with install.swm files inside (option 2 only).
     
  14. Zilch510

    Zilch510 MDL Novice

    May 5, 2022
    16
    7
    0
    #1954 Zilch510, May 28, 2022
    Last edited: Jun 14, 2022
    Not sure if I am allowed to post this, but it's a little script I wrote to *do some activation crap* reliably using @abbodi1406's C2R-R2V-AIO.cmd and KMS_VL_ALL_AIO.cmd. Mods are probably gonna yell at me if I specify its specific function.

    Planning some minor improvements which will be finished by next weekend, including clever path detection and automatically detecting the filename (main.bat).

    Some very important rules!...
    1. Do not put any funny characters in the file path to the main folder, including ' & and whatever else.
    2. The code I am posting here NEEDS to be saved as "main.bat". If the name is anything else you will not be able to get admin if launching normally.
    3. I am not responsible for damage to your system. Please test your specific configuration in a virtual machine first!!!

    I am actually quite proud with the results. I found that for some reason, using just KMS_VL_ALL doesn't always work 100% with the /o argument. So I also added C2R-R2V which makes the whole thing very rugged overall. I also used a fairly interesting method to gain admin in Windows for CMD. Please let me know what you think and leave any suggestions!


    Folder structure needs to look like this...


    folder
    |___main.bat

    |___bin
    |___C2R-R2V-AIO.cmd
    |___KMS_VL_ALL_AIO.cmd


    And finally, here is the code (copy/paste in Notepad++ and save as main.bat)...

    Code:
    @echo off
    set HardPATH=%~dp0
    set FileNAME=main.bat
    
    
    :: First, we will check if the main script was executed with
    :: administrative privileges.  If said privileges are present
    :: we can jump straight to MainCODE.
    :Admin
        >nul 2>&1 "%systemroot%\system32\cacls.exe" "%systemroot%\system32\config\system"
    
        :: If error flag set, we do not have admin.
        if '%errorlevel%' NEQ '0' (
            echo Requesting administrative privileges...
            goto GetUAC
        ) else ( goto MainCODE )
    
    
    :: If we need to get administrative privileges, a temporary
    :: Batch file is created which starts PowerShell as admin.
    :: From there, we can navigate back to our working directory
    :: and lauch the original file as admin.
    :GetUAC
        cd %Temp%
        echo call powershell.exe -Command "Start-Process cmd.exe -ArgumentList '/c cd %HardPATH% && call %FileNAME%' -Verb RunAs" > debug.bat
        echo exit >> debug.bat
        call debug.bat
        if exist "%Temp%\debug.bat" ( del "%Temp%\debug.bat" )
        exit
    
    
    :: Now that we have administrative rights, the
    :: main scripts can be executed in sequential order.
    :MainCODE
        cd %HardPATH%\bin && call C2R-R2V-AIO.cmd && cls
    
        echo ;
        echo ; Executing KMS_VL_ALL, for Office only.  Please wait a minute or two for completion!
        echo ;
    
        call KMS_VL_ALL_AIO.cmd /a /s /o /c && pause
    
     
  15. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,679
    103,527
    450
    Isn't C2R-R2V already in KMS_VL_ALL?
     
  16. Zilch510

    Zilch510 MDL Novice

    May 5, 2022
    16
    7
    0
    I think it may be, but I haven't even bothered to look. I just found that for some odd reason just KMS_VL_ALL did not always for for me, but using both scripts always worked 100% flawless. I tested multiple configurations on at least a dozen VMs running Windows 10.
     
  17. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,679
    103,527
    450
  18. 正义羊

    正义羊 MDL Senior Member

    Feb 21, 2016
    258
    152
    10
    Main Program hasn't any problem. Maybe I need change multi_arch_iso.cmd to older version.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  19. tracknot

    tracknot MDL Novice

    Apr 20, 2022
    20
    3
    0
    This is gonna help me learn a lot of things I am unaware of. Thanks for the great collection, mate.
     
  20. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    17,209
    90,791
    340
    KMS_VL_ALL v47