Ventoy2Disk Command-Line Options Explained: Using -U, -F, and -Y for Automated Deployment

The -U, -F, and -Y flags in Ventoy2Disk.exe disable USB-only filters, bypass safety confirmation dialogs, and enable fully non-interactive installation on any physical drive, making them essential for scripting bulk Ventoy deployments.

Ventoy2Disk is the Windows utility in the ventoy/Ventoy repository responsible for writing the Ventoy bootloader to physical disks. When launched from the command line, it parses arguments in Ventoy2Disk/Ventoy2Disk/Ventoy2Disk.c to set global flags that alter the installation flow, safety checks, and user interaction requirements.

Understanding Ventoy2Disk Command-Line Syntax

By default, Ventoy2Disk.exe operates in interactive GUI mode with safety filters enabled. It only lists USB external drives and requires manual confirmation before writing partition tables. The command-line options -U, -F, and -Y override these defaults by modifying the global state variables g_FilterUSB, g_ForceOperation, and g_NoNeedInputYes declared in the source.

The -U Option: Bypassing the USB-Only Filter

The -U (or lowercase -u) flag disables the built-in restriction that limits Ventoy installation to USB storage devices.

Source Code Implementation in Ventoy2Disk.c

In Ventoy2Disk/Ventoy2Disk/Ventoy2Disk.c at lines 46-50, the option parser sets g_FilterUSB = 0 when detecting the -U argument:

if (strncmp(__argv[i], "-U", 2) == 0 || strncmp(__argv[i], "-u", 2) == 0)
{
    g_FilterUSB = 0;
}

Later, during drive enumeration at lines 382-386, the code checks this flag before filtering out non-USB devices:

if (g_FilterUSB && BusType != BusTypeUsb)
{
    continue;
}

Security Implications and Use Cases

Use -U to install Ventoy on internal SATA or NVMe drives, enabling bootable internal storage for fixed workstations or embedded systems. However, this removes a critical safety guard: the tool will list and allow selection of your primary system disk, and the subsequent write operation replaces the partition table. Always verify the target physical drive number (e.g., \\.\PhysicalDrive2) before combining -U with automation flags.

The -F Option: Forcing Operations Past Safety Checks

The -F flag sets g_ForceOperation = 1, instructing Ventoy2Disk to proceed with the installation even when internal heuristics detect potential conflicts.

How g_ForceOperation Suppresses Warnings

In Ventoy2Disk/Ventoy2Disk/WinDialog.c at lines 337-340, the confirmation dialog logic checks this global before displaying the "Are you sure?" warning:

if (g_ForceOperation == 0)
{
    // Show warning dialog
}

When g_ForceOperation is true, the code bypasses this branch and continues directly to the disk-write routines. This also overrides checks for existing Ventoy installations or partition size mismatches that would normally trigger interactive warnings.

When to Use Force Mode in Automation

Deploy -F in scripted environments where human intervention is impossible, such as CI/CD pipelines creating bootable test environments or IT departments imaging multiple technician USB drives simultaneously. Because -F eliminates confirmation prompts, ensure your script implements its own validation logic to confirm the correct target drive before invoking the command.

The -Y Option: Non-Interactive Installation Mode

The -Y (or -y) flag enables fully automated installation by pre-answering all "Yes/No" prompts with affirmative responses.

Auto-Confirming Prompts in WinDialog.c

In Ventoy2Disk/Ventoy2Disk/Ventoy2Disk.c at lines 55-58, the parser sets g_NoNeedInputYes = 1:

else if (strncmp(__argv[i], "-Y", 2) == 0 || strncmp(__argv[i], "-y", 2) == 0)
{
    g_NoNeedInputYes = 1;
}

This flag is consumed in WinDialog.c at lines 1260-1263, where the code conditionally enables the final "Update" button based on whether human confirmation is required:

if ((g_NoNeedInputYes == 0) && IsWindowEnabled(g_BtnUpdateHwnd))
{
    // Wait for user click
}

When g_NoNeedInputYes is active, the program proceeds through the final installation steps without waiting for GUI interaction, allowing the process to terminate automatically upon completion.

Complete Silent Deployment Examples

For a fully silent installation on an internal drive suitable for enterprise imaging:

Ventoy2Disk.exe -U -F -Y \\.\PhysicalDrive2

For automated USB staging without internal drives:

for %%D in (\\.\PhysicalDrive1 \\.\PhysicalDrive3) do (
    Ventoy2Disk.exe -F -Y "%%D"
)

Combining Flags for Advanced Deployment Scenarios

Flag Combination Behavior Risk Level
-U only Lists internal drives; still asks for confirmation Medium
-F only Skips warnings; still requires final "Yes" click Low-Medium
-Y only Auto-accepts prompts; still filters for USB drives Low
-U + -F Can write to internal drives without warnings High
-U + -F + -Y Fully automated write to any drive, zero interaction Critical

Best Practice: Always run Ventoy2Disk.exe without flags first to identify the correct physical drive number, then add automation flags only after verifying the target.

Summary

  • -U disables the USB-only filter (g_FilterUSB = 0) in Ventoy2Disk.c, allowing installation on internal SATA/NVMe drives.
  • -F sets g_ForceOperation = 1 to bypass safety warnings and existing Ventoy checks defined in WinDialog.c.
  • -Y sets g_NoNeedInputYes = 1 to eliminate all "Yes/No" prompts, enabling fully silent, scriptable installations.
  • These flags are parsed in Ventoy2Disk/Ventoy2Disk/Ventoy2Disk.c and consumed in Ventoy2Disk/Ventoy2Disk/WinDialog.c to control the installation flow.

Frequently Asked Questions

What happens if I use Ventoy2Disk without any flags?

Running Ventoy2Disk.exe with only the target drive argument launches the interactive GUI mode. The program scans for USB-connected drives only (filtering out internal disks), displays safety warnings if the drive already contains Ventoy or appears to have a partition size mismatch, and requires you to manually click "Yes" or "Update" to proceed with the installation.

Can I damage my internal hard drive using the -U option?

Yes. The -U flag removes the USB bus-type filter that normally prevents Ventoy2Disk from listing internal SATA or NVMe drives. When combined with automation flags like -F and -Y, the utility can overwrite the partition table of your system drive without warning, rendering your computer unbootable and causing total data loss. Always verify the physical drive number using diskpart or Device Manager before using -U.

Is it safe to use -F and -Y together in production scripts?

Using -F (force) and -Y (auto-yes) together is safe only if your script implements rigorous pre-validation of the target device. These flags disable the built-in safety checks and confirmation dialogs that prevent accidental overwrites. In production environments, you should query the drive's vendor ID, serial number, or size via WMI or PowerShell before invoking Ventoy2Disk.exe -F -Y to ensure you are writing to the intended removable media and not a fixed disk.

How do I verify which physical drive number corresponds to my USB stick?

Before using command-line automation, launch Ventoy2Disk.exe without flags and note the drives listed in the dropdown menu, which shows friendly names and sizes. Alternatively, use Windows Management Instrumentation (WMI) by running wmic diskdrive get index,model,size,interfacetype in Command Prompt to map the "Index" number (e.g., 2) to the physical drive path (\\.\PhysicalDrive2). Cross-reference the model name and size to confirm you have selected the correct removable device before applying destructive operations.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →