# Отключение Hotplug для Windows ВМ

Отключение возможности извлечения устройств hotplug выполняется с помощью `.bat`-скрипта, добавленного в автозагрузку.

### 1. Получите путь к экземпляру устройства

* Откройте **Диспетчер устройств**.
* Свойства нужного устройства -> вкладка Сведения -> Путь к экземпляру.
* Скопируйте значение (пример: `PCI\VEN_1AF4&DEV_1042\...`).

### 2. Создайте bat-скрипт

Файл `disable_hotplug.bat`:

```
@echo off
reg.exe add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI\VEN_1AF4&DEV_1042&..." /v Capabilities /t REG_DWORD /d 2 /f
```

Где `Capabilities=2` — отключает извлечение устройства.

### 3. Добавьте в автозагрузку

* Нажмите `Win + R` -> `shell:startup`
* Скопируйте туда `disable_hotplug.bat`

{% hint style="info" %}
Скрипт должен запускаться **от имени администратора**. Для этого настройте задачу в планировщике с правами highest.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kb.pvhostvm.ru/hostvm-server/rukovodstvo-po-administrirovaniyu/chasto-zadavaemye-voprosy/virtualnye-mashiny-i-shablony/otklyuchenie-hotplug-dlya-windows-vm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
