====== Управление автозапуском CD-ROM/Flash Drive ====== ===== Физические устройства ===== **Преамбула:** При установке[[http://www.vmware.com/products/ws/|VMware Workstation]] под Win она рекомендует отключить автозапуск CD, заодно отключая его и для сменных носителей. Поскольку у меня на флэшке организовано USB-Menu через Autorun.inf в корне (стартует автоматом [[http://www.pegtop.de/start/|PStart]] для запуска portable soft c нее), захотелось вернуть все взад :) Всякие TweakUI и XPTweaker-ы бодро рапортавали что мол, дескать, Autorun Enable итд, но результат при этом был нулевой, (даже пункта меню AutoPlay в свойствах флэшки не было). **Амбула:** Гугление, как обычно, поправило ситуацию: [[http://www.pctools.com/guides/registry/detail/1142/ |Select the Drive Types to Start Automatically]]; [[http://forum.ixbt.com/topic.cgi?id=22:63213| Отключение автозапуска (Autorun) приводов (CD-ROM, Flash) в windows 2000/XP/2003]] **Постамбула**: Управление автозапуском осуществляется стандартным шаблоном групповой политики: gpedit.msc -> //Computer Configuration -> Administrative Templates -> System// ->**Turn Off Autoplay** . А более тонко - редактированием ключа реестра **NoDriveTypeAutoRun** (REG_DWORLD): //HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer\NoDriveTypeAutoRun// Значение ключа - 8-и битное число, каждый бит, установленный в 1 отключает автозапуск устройств определенного типа: ^ Bit ^ Hex Value ^ Drive Types ^ | 0 | 0x1 | Unknown drives ^ | 1 | 0x4 | No root directory ^ | 2 | 0x8 | Removable drives (Floppy, ZIP) ^ | 3 | 0x10 | Hard disk drives ^ | 4 | 0x20 | Network drives ^ | 5 | 0x40 | CD-ROM drives ^ | 6 | 0x80 | RAM disk drives ^ | 7 | 0xFF | Reserved ^ Типовые значения ключа для WindowsXP: |**0x91 (145)**| значение по умолчанию (автозапуск отключен для сетевых и неизвестных дисков) | |**0x80 (128)**| включение автозапуска для всех типов носителей | |**0xFF (255)**| отключение автозапуска для всех типов носителей | |**0xB5 (181)**| отключение для CD (для флэшек разрешен) | |**0x95 (149)**| отключение для флэшек (для СD разрешен) | ===== Логические устройства ===== Возможно отключение автозапуска дисков, котороым присвоена определенная буква. Раздел реестра: //HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer// Ключ реестра (REG_DWORD): **NoDriveAutoRun** Значение по умолчанию: **0x0** Допустимые значения: **0x0–0x3FFFFFF** Значение представляет собой "битовую карту" дисков справа налево - крайний правый бит (в двоичном представлении) соответствует диску А, второй справа - B и так далее. Для отключения автозапуска бит должен быть установлен в 1. ===== Отключение автозапуска ===== http://support.microsoft.com/kb/967715/ http://www.softboard.ru/index.php?showtopic=51978 __AutoRun.Disabled.reg__ REGEDIT4 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdrom] "AutoRun"=dword:00000000 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer] "NoDriveTypeAutoRun"=dword:000000ff [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\Autorun.inf] @="@SYS:DoesNotExist" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\CancelAutoplay\Files] "*.*"="" __AutoRun.Enabled.reg__ REGEDIT4 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdrom] "AutoRun"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer] "NoDriveTypeAutoRun"=dword:00000000 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\Autorun.inf] @=- [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\CancelAutoplay\Files] "*.*"=- __AutoRun.Policy.adm__ gpedit.msc -> View -> Filtering... -> No checkboxes! Computer Configuration -> Administrative Templates -> System - > Autostart #if version >= 1 CLASS MACHINE CATEGORY System CATEGORY AutoStart POLICY !!CDROM_Autorun_Str KEYNAME "SYSTEM\CurrentControlSet\Services\Cdrom" EXPLAIN !!CDROM_Autorun_Help_Str PART !!CD_AuroRun_Box_Str DROPDOWNLIST REQUIRED VALUENAME "AutoRun" ITEMLIST NAME On VALUE NUMERIC 1 DEFAULT NAME Off VALUE NUMERIC 0 END ITEMLIST END PART END POLICY POLICY !!Autorun_Str #if version >= 4 SUPPORTED !!SUPPORTED_Win2k_Str #endif KEYNAME "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" EXPLAIN !!Autorun_Help_Str PART !!Autorun_Box_Str DROPDOWNLIST REQUIRED VALUENAME "NoDriveTypeAutoRun" ITEMLIST NAME !!Autorun_NoCD_Str VALUE NUMERIC 181 DEFAULT NAME !!Autorun_NoFlash_Str VALUE NUMERIC 149 NAME !!Autorun_NoNet_Str VALUE NUMERIC 145 NAME !!Autorun_None_Str VALUE NUMERIC 255 END ITEMLIST END PART END POLICY POLICY !!AutorunInf_Str KEYNAME "SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\Autorun.inf" EXPLAIN !!AutorunInf_Str_Help VALUENAME "" VALUEON "@SYS:DoesNotExist" VALUEOFF "" END POLICY POLICY !!AutoplayFiles_Str KEYNAME "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\CancelAutoplay\Files" EXPLAIN !!AutoplayFiles_Str_Help VALUENAME "*.*" VALUEON "" END POLICY END CATEGORY ; AutoStart END CATEGORY ; System CLASS USER CATEGORY System CATEGORY AutoStart POLICY !!Autorun_Str #if version >= 4 SUPPORTED !!SUPPORTED_Win2k_Str #endif KEYNAME "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" EXPLAIN !!Autorun_Help_Str PART !!Autorun_Box_Str DROPDOWNLIST REQUIRED VALUENAME "NoDriveTypeAutoRun" ITEMLIST NAME Disable VALUE NUMERIC 181 DEFAULT NAME Enable VALUE NUMERIC 149 END ITEMLIST END PART END POLICY END CATEGORY ; AutoStart END CATEGORY ; AdministrativeServices #endif [strings] CDROM_Autorun_Str="Autorun feature of cdrom service" CDROM_Autorun_Help_Str="CDrom Autorunfeature\nDetermines whether the system sends a Media Change Notification (MCN) message to the Windows interface when it detects that a CD-ROM is inserted in the drive. The MCN message triggers media-related features, such as Autoplay.\n\nIf the MCN message is disabled, the media features that use it do not operate.\n\nAutorun=Off(0) - Does not send an MCN message\nAutorun=On(1) - Sends an MCN message\n\nhttp://technet.microsoft.com/en-us/library/cc976182.aspx" CD_AuroRun_Box_Str="CD AutoRun ->" Autorun_Str="Turn off Autoplay" Autorun_Box_Str="Turn off Autoplay on:" Autorun_NoCD_Str="CD/DVD Drives" Autorun_NoNet_Str="Network and Unknown Drives" Autorun_NoFlash_Str="Removable Flash Drives" Autorun_None_Str="All Drives" Autorun_Help_Str="Turns off the Autoplay feature.\n\nAutoplay begins reading from a drive as soon as you insert media in the drive. As a result, the setup file of programs and the music on audio media start immediately.\n\nBy default, Autoplay is disabled on removable drives, such as the floppy disk drive (but not the CD-ROM drive), and on network drives.\n\nIf you enable this setting, you can also disable Autoplay on CD-ROM drives or disable Autoplay on all drives.\n\nThis setting disables Autoplay on additional types of drives. You cannot use this setting to enable Autoplay on drives on which it is disabled by default.\n\nNote: This setting appears in both the Computer Configuration and User Configuration folders. If the settings conflict, the setting in Computer Configuration takes precedence over the setting in User Configuration.\n\nNote: This setting does not prevent Autoplay for music CDs." SUPPORTED_Win2k_Str="At least Microsoft Windows 2000" AutorunInf_Str="Block autorun.inf file" AutorunInf_Str_Help="Block autorun.inf file:\n\n[HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\Autorun.inf\@="@SYS:DoesNotExist"]" AutoplayFiles_Str="Block all autoplay files" AutoplayFiles_Str_Help="Block all types of autorun files:\n\n[SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\CancelAutoplay\Files\*.*"