Как включить или выключить устройство с рабочего стола: что понадобится?
Одно условие, которое не позволяет воспользоваться установкой прямо сейчас, – утилита devcon.exe из Windows Driver Kit Однако загружать весь WDK для установки одной и легкой утилиты – не вариант.
Поэтому я предоставляю готовые файлы для загрузки. Хочу подчеркнуть, что версия CAB-файла должна соответствовать версии Windows. Пожалуйста, имейте в виду, что версия Windows может измениться к тому времени, когда вы будете читать эту статью.
- Распакуйте файл, выберите размер версии для Windows
- Откройте CAB двойным щелчком (если devcon.exe уже распакован, пропустите шаг 4)
- Скопируйте набор файлов для вашей Windows и переименуйте его в devcon.exe
- Закиньте полученный devcon.exe в папку System32 вашей Windows, что позволит разместить утилиту в системном трее
Devcon classes
Devcon Classes Command Lists all device setup classes. Valid on local and remote computers. DEVCON.EXE [-m:<machine>] classes <machine> Specifies a remote computer. Class entries have the format <name>: <descr> where <name> is the class name and <descr> is the class description.
Ведущая страница данного документа
Go to the DEVCON main page
Devcon classfilter
Devcon Classfilter Command Lists, adds, deletes, and reorders upper and lower filter drivers for a device setup class. Changes do not take effect until the affected devices are restarted or the machine is rebooted. DEVCON.EXE classfilter [-r] <class> {upper | lower} [<operator><filter> [<operator><filter>...]] <class> Specifies a device setup class. <operator> Specifies an operation (listed below). <filter> Specifies a class filter driver. upper Identifies an upper filter driver. lower Identifies a lower filter driver. To list the upper/lower filter drivers for a class, type: devcon classfilter <class> {upper | lower} The Devcon classfilter command uses subcommands, which consist of an operator (=, @, -, , !) and a filter driver name. The Devcon classfilter command uses a virtual cursor to move through the list of filter drivers. The cursor starts at the beginning of the list (before the first filter). Unless returned to the starting position, the cursor always moves forward. Operators = Move the cursor to the beginning of the filter driver list (before the first filter driver). @ Position the cursor on the next instance of the specified filter. - Add before. Insert the specified filter before the filter on which the cursor is positioned. If the cursor is not positioned on a filter, insert the new filter at the beginning of the list. When the subcommand completes, the cursor is positioned on the newly-added filter. Add after. Insert the specified filter after the filter on which the cursor is positioned. If the cursor is not positioned on a filter, Devcon inserts the new filter at the end of the list. When the subcommand completes, the cursor cursor is positioned on the newly-added filter. ! Deletes the next occurrence of the specified filter. When the subcommand completes, the cursor occupies the position of the deleted filter. Subsequent - or subcommands insert a new filter at the cursor position. Examples: If the upper filters for setup class "foo" are A,B,C,B,D,B,E: DEVCON.EXE classfilter foo upper @D !B - deletes the third 'B'. DEVCON.EXE classfilter foo upper !B !B !B - deletes all three instances of 'B'. DEVCON.EXE classfilter foo upper =!B =!A - deletes the first 'B' and the first 'A'. DEVCON.EXE classfilter foo upper !C CC - replaces 'C' with 'CC'. DEVCON.EXE classfilter foo upper @D -CC - inserts 'CC' before 'D'. DEVCON.EXE classfilter foo upper @D CC - inserts 'CC' after 'D'. DEVCON.EXE classfilter foo upper -CC - inserts 'CC' before 'A'. DEVCON.EXE classfilter foo upper CC - inserts 'CC' after 'E'. DEVCON.EXE classfilter foo upper @D X Y - inserts 'X' after 'D' and 'Y' after 'X'. DEVCON.EXE classfilter foo upper @D -X -Y - inserts 'X' before 'D' and 'Y' before 'X'. DEVCON.EXE classfilter foo upper @D -X Y - inserts 'X' before 'D' and 'Y' between 'X' and 'D'.
Ведущая страница данного документа
Go to the DEVCON main page
Devcon disable
Devcon Disable Command Disables devices with the specified hardware or instance ID. Valid only on the local computer. (To reboot when necesary, Include -r .) DEVCON.EXE [-r] disable <id> [<id>...] DEVCON.EXE [-r] disable =<class> [<id>...] -r Reboots the system only when a restart or reboot is required. <class> Specifies a device setup class. Examples of <id>: * - All devices ISAPNPPNP0501 - Hardware ID *PNP* - Hardware ID with wildcards (* matches anything) @ISAPNP** - Instance ID with wildcards (@ prefixes instance ID) '*PNP0501 - Hardware ID with apostrophe (' prefixes literal match - matches exactly as typed, including the asterisk.)
Ведущая страница данного документа
Перейти на главную страницу ДЕВКОН
Devcon dp_add
DEVCON.EXE dp_add <inf> Adds (installs) a third-party (OEM) driver package. This command will only work on the local machine. <inf> is a full path to the INF of the Driver Package that will be installed on this machine.
Ведущая страница данного документа
Go to the DEVCON main page
Devcon dp_delete
DEVCON.EXE [-f] dp_delete <inf> Deletes a third-party (OEM) driver package. This command will only work on the local machine. [-f] will force delete the driver package, even if it is in use by a device. <inf> is the name of a published INF on the local machine. This is the value returned from dp_add and dp_enum.
Ведущая страница данного документа
Go to the DEVCON main page
Devcon dp_enum
DEVCON.EXE dp_enum Lists the third-party (OEM) driver packages installed on this machine. This command will only work on the local machine. Values returned from dp_enum can be sent to dp_delete to be removed from the machine.
Ведущая страница данного документа
Go to the DEVCON main page
Devcon driverfiles
Devcon Driverfiles Command List installed driver files for devices with the specified hardware or instance ID. Valid only on the local computer. DEVCON.EXE driverfiles <id> [<id>...] DEVCON.EXE driverfiles =<class> [<id>...] <class> Specifies a device setup class. Examples of <id>: * - All devices ISAPNPPNP0501 - Hardware ID *PNP* - Hardware ID with wildcards (* matches anything) @ISAPNP** - Instance ID with wildcards (@ prefixes instance ID) '*PNP0501 - Hardware ID with apostrophe (' prefixes literal match - matches exactly as typed, including the asterisk.)
Ведущая страница данного документа
Go to the DEVCON main page
Devcon drivernodes
Devcon Drivernodes Command Lists driver nodes for devices with the specified hardware or instance ID. Valid only on the local computer. DEVCON.EXE drivernodes <id> [<id>...] DEVCON.EXE drivernodes =<class> [<id>...] <class> Specifies a device setup class. Examples of <id>: * - All devices ISAPNPPNP0501 - Hardware ID *PNP* - Hardware ID with wildcards (* matches anything) @ISAPNP** - Instance ID with wildcards (@ prefixes instance ID) '*PNP0501 - Hardware ID with apostrophe (' prefixes literal match - matches exactly as typed, including the asterisk.)
Ведущая страница данного документа
Перейти на главную страницу ДЕВКОН
Devcon enable
Devcon Enable Command Enables devices with the specified hardware or instance ID. Valid only on the local computer. (To reboot when necessary, include -r.) DEVCON.EXE [-r] enable <id> [<id>...] DEVCON.EXE [-r] enable =<class> [<id>...] -r Reboots the system only when a restart or reboot is required. <class> Specifies a device setup class. Examples of <id>: * - All devices ISAPNPPNP0501 - Hardware ID *PNP* - Hardware ID with wildcards (* matches anything) @ISAPNP** - Instance ID with wildcards (@ prefixes instance ID) '*PNP0501 - Hardware ID with apostrophe (' prefixes literal match - matches exactly as typed, including the asterisk.)
Ведущая страница данного документа
Go to the DEVCON main page
Devcon find
Devcon Find Command Finds devices with the specified hardware or instance ID. Valid on local and remote computers. DEVCON.EXE [-m:<machine>] find <id> [<id>...] DEVCON.EXE [-m:<machine>] find =<class> [<id>...] <machine> Specifies a remote computer. <class> Specifies a device setup class. Examples of <id>: * - All devices ISAPNPPNP0501 - Hardware ID *PNP* - Hardware ID with wildcards (* matches anything) @ISAPNP** - Instance ID with wildcards (@ prefixes instance ID) '*PNP0501 - Hardware ID with apostrophe (' prefixes literal match - matches exactly as typed, including the asterisk.) Device entries have the format <instance>: <descr> where <instance> is the unique instance of the device and <descr> is the device description.
Вернуться к началу этой страницы
Go to the DEVCON main page
Devcon findall
Devcon Findall Command Finds devices with the specified hardware or instance ID, including devices that are not currently attached. Valid on local and remote computers. DEVCON.EXE [-m:<machine>] findall <id> [<id>...] DEVCON.EXE [-m:<machine>] findall =<class> [<id>...] <machine> Specifies a remote computer. <class> Specifies a device setup class. Examples of <id>: * - All devices ISAPNPPNP0501 - Hardware ID *PNP* - Hardware ID with wildcards (* matches anything) @ISAPNP** - Instance ID with wildcards (@ prefixes instance ID) '*PNP0501 - Hardware ID with apostrophe (' prefixes literal match - matches exactly as typed, including the asterisk.) Device entries have the format <instance>: <descr> where <instance> is the unique instance of the device and <descr> is the description.
Ведущая страница данного документа
Go to the DEVCON main page
Devcon hwids
Devcon Hwids Command Lists hardware IDs of all devices with the specified hardware or instance ID. Valid on local and remote computers. DEVCON.EXE [-m:<machine>] hwids <id> [<id>...] DEVCON.EXE [-m:<machine>] hwids =<class> [<id>...] <machine> Specifies a remote computer. <class> Specifies a device setup class. Examples of <id>: * - All devices ISAPNPPNP0501 - Hardware ID *PNP* - Hardware ID with wildcards (* matches anything) @ISAPNP** - Instance ID with wildcards (@ prefixes instance ID) '*PNP0501 - Hardware ID with apostrophe (' prefixes literal match - matches exactly as typed, including the asterisk.)
Ведущая страница данного документа
Go to the DEVCON main page
Devcon install
Devcon Install Command Installs the specified device manually. Valid only on the local computer. (To reboot when necesary, Include -r .) DEVCON.EXE [-r] install <inf> <hwid> <inf> Specifies an INF file with installation information for the device. <hwid> Specifies a hardware ID for the device. -r Reboots the system only when a restart or reboot is required.
Ведущая страница данного документа
Go to the DEVCON main page
Devcon listclass
Devcon Listclass Command Lists all devices in the specified setup classes. Valid on local and remote computers. DEVCON.EXE [-m:<machine>] listclass <class> [<class>...] <machine> Specifies a remote computer. <class> Specifies a device setup class. Device entries have the format <instance>: <descr> where <instance> is a unique instance of the device and <descr> is the device description.
Вернуться к началу этой страницы
Go to the DEVCON main page
Devcon reboot
DEVCON.EXE reboot Reboots the local computer as part of a planned hardware installation.
Ведущая страница данного документа
Go to the DEVCON main page
Devcon remove
Devcon Remove Command Removes devices with the specified hardware or instance ID. Valid only on the local computer. (To reboot when necesary, Include -r .) DEVCON.EXE [-r] remove <id> [<id>...] DEVCON.EXE [-r] remove =<class> [<id>...] <class> Specifies a device setup class. Examples of <id>: * - All devices ISAPNPPNP0501 - Hardware ID *PNP* - Hardware ID with wildcards (* matches anything) @ISAPNP** - Instance ID with wildcards (@ prefixes instance ID) '*PNP0501 - Hardware ID with apostrophe (' prefixes literal match - matches exactly as typed, including the asterisk.)
Ведущая страница данного документа
Go to the DEVCON main page
Devcon rescan
Devcon Rescan Command Directs Plug and Play to scan for new hardware. Valid on a local or remote computer. DEVCON.EXE [-m:<machine>] <machine> Specifies a remote computer.
Ведущая страница данного документа
Go to the DEVCON main page
Devcon resources
Devcon Resources Command Lists hardware resources of devices with the specified hardware or instance ID. Valid on local and remote computers. DEVCON.EXE [-m:<machine>] resources <id> [<id>...] DEVCON.EXE [-m:<machine>] resources =<class> [<id>...] <machine> Specifies a remote computer. <class> Specifies a device setup class. Examples of <id>: Examples of <id>: * - All devices ISAPNPPNP0501 - Hardware ID *PNP* - Hardware ID with wildcards (* matches anything) @ISAPNP** - Instance ID with wildcards (@ prefixes instance ID) '*PNP0501 - Hardware ID with apostrophe (' prefixes literal match - matches exactly as typed, including the asterisk.)
Ведущая страница данного документа
Go to the DEVCON main page
Devcon restart
Devcon Restart Command Restarts devices with the specified hardware or instance ID. Valid only on the local computer. (To reboot when necesary, Include -r .) DEVCON.EXE [-r] restart <id> [<id>...] DEVCON.EXE [-r] restart =<class> [<id>...] <class> Specifies a device setup class. Examples of <id>: * - All devices ISAPNPPNP0501 - Hardware ID *PNP* - Hardware ID with wildcards (* matches anything) @ISAPNP** - Instance ID with wildcards (@ prefixes instance ID) '*PNP0501 - Hardware ID with apostrophe (' prefixes literal match - matches exactly as typed, including the asterisk.)
Ведущая страница данного документа
Go to the DEVCON main page
Devcon sethwid
DEVCON.EXE [-m:<machine>] sethwid <id> [<id>...] := <subcmds> DEVCON.EXE [-m:<machine>] sethwid =<class> [<id>...] := <subcmds> Modifies the hardware ID's of the listed devices. This command will only work for root-enumerated devices. This command will work for a remote machine. Examples of <id> are: * - All devices (not recommended) ISAPNPPNP0601 - Hardware ID *PNP* - Hardware ID with wildcards (* matches anything) @ROOT** - Instance ID with wildcards (@ prefixes instance ID) <class> is a setup class name as obtained from the classes command. <subcmds> consists of one or more: =hwid - Clear hardware ID list and set it to hwid. hwid - Add or move hardware ID to head of list (better match). -hwid - Add or move hardware ID to end of list (worse match). !hwid - Remove hardware ID from list. hwid - each additional hardware id is inserted after the previous.
Вернуться к началу этой страницы
Go to the DEVCON main page
Devcon stack
Devcon Stack Command Lists the expected driver stack of devices with the specified hardware or instance ID. PnP calls each driver's AddDevice routine when building the device stack. Valid on local and remote computers. DEVCON.EXE [-m:<machine>] stack <id> [<id>...] DEVCON.EXE [-m:<machine>] stack =<class> [<id>...] <machine> Specifies a remote computer. <class> Specifies a device setup class. Examples of <id>: * - All devices ISAPNPPNP0501 - Hardware ID *PNP* - Hardware ID with wildcards (* matches anything) @ISAPNP** - Instance ID with wildcards (@ prefixes instance ID) '*PNP0501 - Hardware ID with apostrophe (' prefixes literal match - matches exactly as typed, including the asterisk.)
Ведущая страница данного документа
Go to the DEVCON main page
Devcon status
Devcon Status Command Lists the running status of devices with the specified hardware or instance ID. Valid on local and remote computers. DEVCON.EXE [-m:<machine>] status <id> [<id>...] DEVCON.EXE [-m:<machine>] status =<class> [<id>...] <machine> Specifies a remote computer. <class> Specifies a device setup class. Examples of <id>: * - All devices ISAPNPPNP0501 - Hardware ID *PNP* - Hardware ID with wildcards (* matches anything) @ISAPNP** - Instance ID with wildcards (@ prefixes instance ID) '*PNP0501 - Hardware ID with apostrophe (' prefixes literal match - matches exactly as typed, including the asterisk.)
Ведущая страница данного документа
Go to the DEVCON main page
Devcon update
Devcon Update Command Updates drivers for all devices with the specified hardware ID (<hwid>). Valid only on the local computer. (To reboot when necesary, Include -r .) DEVCON.EXE [-r] update <inf> <hwid> -r Reboots the system only when a restart or reboot is required. <inf> Specifies an INF file with installation information for the devices. <hwid> Specifies the hardware ID of the devices.
Ведущая страница данного документа
Перейти на главную страницу ДЕВКОН
Devcon updateni
DEVCON.EXE [-r] updateni <inf> <hwid> Update drivers for devices (Non Interactive). This command will only work for local machine. Specify -r to reboot automatically if needed. <inf> is an INF to use to install the device. All devices that match <hwid> are updated. Unsigned installs will fail. No UI will be presented.
Ведущая страница данного документа
Go to the DEVCON main page
Включение/отключение устройства из командной строки (cmd) — libixur — мой блог
.
У меня на компьютере часто стояла DVB-карта для просмотра спутникового телевидения, в диспетчере устройств появлялось сообщение “Это устройство не может быть запущено”. И тогда мне приходилось заходить в диспетчер устройств и отсоединять карту, чтобы включить телевизор. Затем включить его снова, после чего я смог подключить программу для просмотра ТВ – потому что программа была отключена на компьютере или планшете с Windows Xbox One (включая iPod).
Для этого нам требуется небольшая утилита Microsoft Devcon. На этой странице находится ссылка на ее загрузку (77,2 кб). Запустите программу, введите C:Temp в качестве пути распаковки и нажмите кнопку Unzip.
После распаковки программы нажмите “Ок”, закройте программу и скопируйте файл devcon.exe из папки C:Tempi386 в папку C Если у вас 64-битная Windows, то файл нужно взять из папки C:Tempia64.
Вот и все, вводная часть готова. Теперь мы можем приступить к написанию bat-файла. В текстовом файле назовем его Run_DVB.bat (он должен иметь расширение bath в конце). Вы можете назвать его любым другим именем, которое вам нравится. Затем щелкните правой кнопкой мыши на этом файле и выберите “Изменить”. Давайте напишем следующие строки:
Где:
- devcon disable «PCIVEN_1969&DEV_1083&SUBSYS_E0001458&REV_C0» — Отключение устройства с заданным ID.
- devcon enable «PCIVEN_1969&DEV_1083&SUBSYS_E0001458&REV_C0» — Включение устройства с заданным ID.
- start dvbdream.exe — Запуск программы просмотра ТВ (Вы прописываете путь к нужной Вам программе или не пишите эту строку совсем).
Чтобы узнать ID, зайдите в диспетчер устройств и откройте свойства нужного вам устройства. Если bat-файл находится не в папке с программой, то путь будет таким: dvbdream.exe
Теперь мы можем переименовать ярлык в “Спутниковое телевидение” и изменить или заменить его на более привлекательный значок (сделайте это, щелкнув правой кнопкой мыши на Свойствах ярлыка). При запуске ярлыка мы перезагрузим устройство перед запуском программы:)
VN:F [1.9.20_1166]
Включение/выключение устройства из командной строки (CMD) 9,2 из 10 на основе 37 оценок.
Написать друзьям
Запуск ярлыка от имени администратора
В этой ситуации вы получите повышенные привилегии. Мы разрешим ему работать с повышенными привилегиями, чтобы можно было легко обойти контекстное меню одним щелчком мыши. Вернитесь на вкладку Shortcut контекстного меню и выберите Advanced. Вы понимаете, что произойдет дальше?
Обязательно внедрите изменения. Я также буду использовать для этого звуковой ярлык.
Думаю, на этом можно закончить. Теоретически, вы можете продолжить. Поэтому прочитайте статью Как скрыть консоль окна cmd, если вы хотите навсегда скрыть окно консоли. Я не буду усложнять статью, и желаю всем удачи.
Как создать ярлык для команды удаления или включения устройства?
Да, ввод Manager предпочтительнее для получения идентификатора устройства. Мы разработаем ярлык для практической команды способом, описанным в статье.
В поле Расположение этикетки укажите
C:WindowsSystem32cmd.exe /k devcon.exe disable «ИД» /quet
Как я могу заглушить звук? с помощью инструкции:.
C:WindowsSystem32cmd.exe /k devcon.exe disable "HDAUDIOFUNC_01&VEN_10EC&DEV_0269&SUBSYS_17AA5011&REV_1002" /quet
Если вам интересно, как создать ярлык для консольных команд, посмотрите по этой ссылке. Я назову его произвольно:
Этикетке можно сразу же придать надлежащий вид. Измените значок этикетки на уже широко используемый:
C:Windowssystem32shell32.dll