용산 전기

용산 전기 오픈

사이트에 오픈하였습니다. 방문해주셔서 감사합니다.문의 전화 : 031-414-8411

회원로그인

자료실
 

Ventoy 명령줄 설치 프로그램


설명
이 스크립트를 사용하면 명령 인터페이스에서 USB/HDD 디스크에 Ventoy를 쉽게 설치할 수 있습니다.


:: INFO:

:: GRUB2 FILE MANAGER SETUP & DOWNLOAD SUITE
:: Copyright (C) 2020  mephistooo2 | TNCTR.com
:: Grub2 File Manager USB Installer Github: https://github.com/abdullah-erturk/SecureBoot-Grub2FM-Suite

:: Ventoy Command Line Installer
:: Copyright (C) 2020  mephistooo2 | TNCTR.com
:: https://github.com/abdullah-erturk/Ventoy-Command-Line-Installer

:: Ventoy & Grub2FM Multiboot (With Original Files)
:: Copyright (C) 2020  mephistooo2 | TNCTR.com
:: Ventoy & Grub2FM Multiboot (With Original Files) Github: https://github.com/abdullah-erturk/Ventoy-Grub2FM-Multiboot-With-Original-Files

:: Ventoy Github: https://github.com/ventoy/Ventoy
:: credit: longpanda
::===============================================================================================================
@echo off
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
cd /d "%~dp0"
for /f "delims=" %%x in (Ventoy\version) do set ver=%%x >nul 2>&1
::===============================================================================================================
:MAINMENU
setlocal enableextensions disabledelayedexpansion
for /f "tokens=6 delims=[]. " %%# in ('ver') do set winbuild=%%#
del %temp%\msg.vbs /f /q >nul 2>&1
echo Set WshShell = CreateObject("WScript.Shell"^) >> %temp%\msg.vbs
echo x = WshShell.Popup ("운영 체제가 Windows 10/11이 아닙니다. 스크립트 파일은 Windows 10/11에서만 실행됩니다. 프로세스는 5초 후에 종료됩니다.",5, "...: 경고" ::..") >> %temp%\msg.vbs
if %winbuild% LSS 10240 (
call %temp%\msg.vbs
del %temp%\msg.vbs /f /q >nul 2>&1
exit
)
::===============================================================================================================
mode con:cols=85 lines=45
title Ventoy 멀티부팅 Suite v%ver% - script made by VenusGirl ^| venusgirls.tistory.com
:Main
cls
echo.
echo =====================================================================================
echo.
echo   Ventoy 멀티부팅 v%ver% - script made by VenusGirl ^| venusgirls.tistory.com
echo.
echo   1 - USB/HDD 디스크에 VENTOY 설치
echo.
echo   2 - VENTOY 업데이트
echo.
echo   3 - VENTOY 웹사이트 방문
echo.
echo   4 - 종료
echo.
echo =====================================================================================
echo.
choice /c 1234 /cs /n /m "선택 : "
echo.
if errorlevel 4 Exit
if errorlevel 3 goto :VenusGirl
if errorlevel 2 goto :Update
if errorlevel 1 goto :Ventoy
echo.
::===============================================================================================================
:Ventoy
call :MsgBox "Ventoy 명령줄 설치에서 오류가 발생하면 오류 경고가 나타나지 않습니다.\n \n따라서 오류가 발생하면 Ventoy 로그 파일을 검토하세요. "  "VBInformation" "..:: 경고 ::.."
echo.  [N]비파괴 설치      [F]포맷 후 설치
echo.
set dest=0
choice /C:NF /N /M "Ventoy 설정은 어떻게 하시겠습니까? : "
if errorlevel 2 goto :Destructive
if errorlevel 1 set dest=1
if errorlevel 1 goto :Non-Destructive
::===============================================================================================================
:Destructive
echo.
set style=
echo.  [G]PT      [M]BR
echo.
choice /C:GM /N /M "Ventoy를 설치할 디스크 구조를 선택합니다 : "
if errorlevel 1 set style=GPT
if errorlevel 2 set style=MBR
echo.

set diskstr=
echo.  [1] NTFS      [2] FAT32      [3] exFAT      [4] UDF
echo.
choice /C:4321 /N /M "Ventoy 설치 후 디스크 저장소의 파티션 구조 선택 : "
if errorlevel 1 set diskstr=UDF
if errorlevel 2 set diskstr=exFAT
if errorlevel 3 set diskstr=FAT32
if errorlevel 4 set diskstr=NTFS
::===============================================================================================================
:ask
echo.
set free=0
echo.  [Y]예      [N]아니오
echo.
choice /C:YN /N /M "설치 후 디스크 끝에 예약 공간을 남기시겠습니까? : "
if errorlevel 2 goto :VentoyInstall
if errorlevel 1 set free=1
if errorlevel 1 goto :free
::===============================================================================================================
:free
echo.
set /p "disksize=원하는 크기를 MB 단위로 입력하세요 : " || goto :free
setlocal enabledelayedexpansion
for /f "delims=0123456789" %%a in ("!disksize!") do set "disksize="
endlocal & set "disksize=%disksize%"

if not defined disksize (
echo.
echo 숫자만 사용하세요
timeout /t 2 > nul
goto :free
    )
set value=40
If %disksize% GEQ %value% (
GOTO :VentoyInstall
) else (
echo.
echo FAT32 크기를 최소 40MB로 입력...
timeout /t 2 > nul
goto :free
)
::===============================================================================================================
:VentoyInstall
call :showDiskTable
    set /p "  diskNumber=Ventoy를 설치할 디스크 번호 입력 : "
echo.
echo 기다려 주세요...
echo.

if %free% equ 1 (
Ventoy2Disk.exe VTOYCLI /I /PhyDrive:%diskNumber% /NOUSBCheck /%style% /FS:%diskstr% /R:%disksize%
goto :freespaceformat
) else (
Ventoy2Disk.exe VTOYCLI /I /PhyDrive:%diskNumber% /NOUSBCheck /%style% /FS:%diskstr%
goto :end
)
::===============================================================================================================
:freespaceformat
set "scriptFile=%temp%\%~nx0.%random%%random%%random%.tmp"
    > "%scriptFile%" (
echo RESCAN
    )
    type "%scriptFile%" >nul
diskpart /s "%scriptFile%" >nul
    del /q "%scriptFile%" >nul

echo.  [Y]예      [N]아니오
echo.
choice /C:YN /N /M "디스크 끝에 예약된 공간을 포맷하시겠습니까? : "
if errorlevel 2 goto :end
if errorlevel 1 goto :yes
::===============================================================================================================
:yes
echo.
echo.  [1] NTFS      [2] FAT32      [3] exFAT      [4] UDF
echo.
choice /C:4321 /N /M "디스크 끝에 있는 예약 공간을 포맷할 파티션 구조를 선택합니다 : "
if errorlevel 1 set diskstr=UDF
if errorlevel 2 set diskstr=exFAT
if errorlevel 3 set diskstr=FAT32
if errorlevel 4 set diskstr=NTFS

call :DriveLetter
set "label=Ventoy"
set q1= $Q1=(gwmi Win32_Volume -filter $('Label='+[char]34+$env:label+[char]34)).DeviceID
set q2= $Q2=(gwmi MSFT_Partition -Namespace root\Microsoft\Windows\Storage ^|where {$_.AccessPaths -contains $Q1}).DiskNumber
for /f %%s in ('powershell -nop -c "%q1%; if ($Q1) {%q2%; $Q2}"') do set disk=%%s

set "scriptFile=%temp%\%~nx0.%random%%random%%random%.tmp"
    > "%scriptFile%" (
echo LIST DISK
echo SELECT DISK %disk%
echo CREATE PARTITION PRIMARY
echo FORMAT QUICK FS=%diskstr% LABEL="Free Space"
echo ASSIGN LETTER=%driveletter%
    )
    type "%scriptFile%" >nul
echo.
echo 디스크의 여유 공간 포맷...
diskpart /s "%scriptFile%" >nul
    del /q "%scriptFile%" >nul
echo.
)

goto :end
::===============================================================================================================
:Non-Destructive
call :MsgBox "비파괴 설치 옵션에서 Ventoy를 설치할 디스크는 NTFS 형식이어야 합니다."  "VBInformation" "..:: 경고 ::.."
echo.
call :showDiskTable
    set /p "  diskNumber=Ventoy 비파괴 설치용 디스크 번호를 입력하세요 : "
echo.
echo 기다려 주세요...
Ventoy2Disk.exe VTOYCLI /I /PhyDrive:%diskNumber% /NonDest /NOUSBCheck

set "scriptFile=%temp%\%~nx0.%random%%random%%random%.tmp"
    > "%scriptFile%" (
echo RESCAN
    )
    type "%scriptFile%" >nul
diskpart /s "%scriptFile%" >nul
    del /q "%scriptFile%" >nul

goto :end
::===============================================================================================================
:end
set "scriptFile=%temp%\%~nx0.%random%%random%%random%.tmp"
    > "%scriptFile%" (
echo RESCAN
    )
    type "%scriptFile%" >nul
diskpart /s "%scriptFile%" >nul
    del /q "%scriptFile%" >nul

echo.
    echo 경고
echo.
call :MsgBox "Ventoy 멀티부팅 설치가 완료되었습니다."  "VBInformation" ".:: Ventoy MultiBoot ::."
choice /C:MX /N /M "M 버튼을 눌러 메인 메뉴로 이동 - X 버튼을 눌러 종료 : "
if errorlevel 2 Exit
if errorlevel 1 goto :Main
::===============================================================================================================
:Update
call :MsgBox "Ventoy 명령줄 설치에서 오류가 발생하면 오류 경고가 나타나지 않습니다.\n \n따라서 오류가 발생하면 Ventoy 로그 파일을 검토하세요. "  "VBInformation" "..:: 경고 ::.."
call :MsgBox "디스크에 이미 \n \nVentoy 멀티부팅 \n \n이 있는 경우 이 파티션을 사용해야 합니다."  "VBInformation" "..:: 경고 ::.."
call :showDiskTable
    echo.
set /p "  diskNumber=Ventoy 설치 디스크를 선택합니다 : "
echo.
echo 기다려 주세요...
Ventoy2Disk.exe VTOYCLI /U /PhyDrive:%diskNumber% /NOUSBCheck

echo.
    echo 확인
echo.
choice /C:MX /N /M "M 버튼을 눌러 메인 메뉴로 이동 - X 버튼을 눌러 종료 : "
if errorlevel 2 Exit
if errorlevel 1 goto :Main
::===============================================================================================================
:showDiskTable
    echo ======================================================
echo 주의: 올바른 디스크를 선택했는지 확인하세요 !!!
echo.
echo list disk | diskpart | findstr /b /c:" "
    echo ======================================================
    goto :eof
::===============================================================================================================
:DriveLetter
    set "driveletter="
    for %%a in (Z Y X W V U T S R Q P O N M L K J I H G F E D C) do cd %%a: 1>>nul 2>&1 & if errorlevel 1 set driveletter=%%a
exit /b 0
::===============================================================================================================
:MsgBox
Rem 64=vbInformation, 48=vbExclamation, 16=vbCritical 32=vbQuestion
    setlocal enableextensions
    set "tempFile=%temp%\%~nx0.%random%%random%%random%vbs.tmp"
>"%tempFile%" echo(WScript.Quit MsgBox(Replace("%~1","\n",vbcrlf),%~2,"%~3") & cscript //nologo //e:vbscript "%tempFile%"
    set "exitCode=%errorlevel%" & del "%tempFile%" >nul 2>nul
    endlocal & exit /b %exitCode%
::===============================================================================================================
:VenusGirl
start https://venusgirls.tistory.com/
start https://github.com/ventoy/Ventoy/releases
goto Main
::===============================================================================================================
최신글

용산 전기 오픈

사이트에 오픈하였습니다.…

최고관리자 07-17

설문조사

test2

설문기간 : 25-04-15~25-04-30
참여하기

기타

실시간 인기 검색어