Last active
February 20, 2023 13:28
-
-
Save BoQsc/7d8f60b10aaa71fdcec689bbb486a7f4 to your computer and use it in GitHub Desktop.
Format USB and install Linux ISO on Windows 10 automated way
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
:wait_for_usb | |
TITLE Waiting for USB | |
FOR /f %%D IN ('wmic LogicalDisk get Caption^, VolumeName ^| find "LINUXUSB"') DO SET "DRIVE=%%D" | |
IF "%DRIVE%"=="" TIMEOUT /T 2 && CLS && GOTO :wait_for_usb | |
TITLE Formatting USB | |
ECHO select volume %DRIVE% > "%TEMP%/diskpartlinuxformat.txt" | |
ECHO clean >> "%TEMP%/diskpartlinuxformat.txt" | |
ECHO create partition primary >> "%TEMP%/diskpartlinuxformat.txt" | |
ECHO select partition 1 >> "%TEMP%/diskpartlinuxformat.txt" | |
ECHO format FS=fat32 label=LINUXUSB quick >> "%TEMP%/diskpartlinuxformat.txt" | |
DISKPART /S "%TEMP%/diskpartlinuxformat.txt" | |
TITLE Writing to USB | |
tar xfv "./linuxmint-21.1-xfce-64bit.iso" -C "%DRIVE%/" | |
TITLE Linux got installed on your USB DRIVE! | |
ECHO EVERYTHING IS DONE! | |
pause | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment