Desativando autorun em pendrives (Atualizado)

Desde 08/02/2011, a atualização KB971029 está disponível no Windows Update. Ela remove por completo do AutoRun a opção "Usando o programa fornecido no dispositivo", com exceção de drives ópticos, trazendo para o Windows XP e Vista (além do Server 2003 e 2008) o comportamento do Windows 7, como explicado aqui.

Depois de instalar, para ter o AutoRun de volta, caso tenha aplicado as alterações sugeridas no post original (abaixo), desfaça-as, excluindo o valor NoDriveTypeAutoRun. Reinicie depois de aplicar:

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoDriveTypeAutoRun"=-

Assim, com a atualização KB971029 instalada, você terá no Windows XP e Vista o mesmo comportamento do AutoRun do Windows 7, muito mais seguro, visto que impede infeccções quase automáticas pelo disparo do AutoRun em dispositivos como pendrives, cartões de memória, etc.

Post original (obsoleto, não usar!)

No Windows XP e Vista é recomendável desativar a execução automática (autorun) para dispositivos removíveis, pois a opção de executar "Usando o programa fornecido no dispositivo" é uma fonte de disseminação de vírus. E para piorar, pouca gente sabe que mesmo cancelando a janela da execução automática, se você for no "Meu Computador" ("Computador" no Vista) e clicar duas vezes para abrir o volume (sem ser pela árvore de pastas da esquerda no Windows Explorer), estará disparando o autorun no modo "Usando o programa fornecido pelo dispositivo" sem necessidade de confirmação!

No Windows 7 esse problema não existe mais (Engineering Windows 7 - Improvements to AutoPlay), porém para quem usa o XP ou Vista, segue o procedimento.

Primeiro você precisa das atualizações KB967715 (XP) ou KB950582 (Vista). Se você deixa as atualizações automáticas habilitadas, não precisa se preocupar, pois elas já estarão instaladas.

Então falta desativar o autorun. Para isso, crie um arquivo de texto com o seguinte conteúdo, salve como desativa_autorun.reg

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoDriveTypeAutoRun"=dword:000000dd

e adicione ao registro. Reinicie a máquina.

O valor dd no final da última linha é que define em quais dispositivos o autorun será desativado. Eu costumo deixar em dd, que mantém-o ativo apenas para drives ópticos, por causa de alguns CDs de instalação que se não forem executados através do autorun não funcionam.

Aqui está uma lista de outras combinações:

;Disables Autoplay on unknown drives only
;"NoDriveTypeAutoRun"=dword:0x00000081

;Disables Autoplay on removable drives omly
;"NoDriveTypeAutoRun"=dword:0x00000004

;Disables Autoplay on fixed drives only
;"NoDriveTypeAutoRun"=dword:0x00000008

;Disables Autoplay on network drives only
;"NoDriveTypeAutoRun"=dword:0x00000010

;Disables Autoplay on CD-ROM drives only
;"NoDriveTypeAutoRun"=dword:0x00000020

;Disables Autoplay on RAM disks only
;"NoDriveTypeAutoRun"=dword:0x00000040

;Disables Autoplay on all drives
;"NoDriveTypeAutoRun"=dword:0x000000ff

;Disables Autoplay on removable drives and fixed drives
;"NoDriveTypeAutoRun"=dword:0x0000000c

;Disables Autoplay on removable drives and network drives
;"NoDriveTypeAutoRun"=dword:0x00000014

;Disables Autoplay on removable drives and CD-ROM drives
;"NoDriveTypeAutoRun"=dword:0x00000024

;Disables Autoplay on removable drives and RAM disks
;"NoDriveTypeAutoRun"=dword:0x00000044

;Disables Autoplay on removable drives and unknown drives
;"NoDriveTypeAutoRun"=dword:0x00000085

;Disables Autoplay on fixed drives and network drives
;"NoDriveTypeAutoRun"=dword:0x00000018

;Disables Autoplay on fixed drives and CD-ROM drives
;"NoDriveTypeAutoRun"=dword:0x00000028

;Disables Autoplay on fixed drives and RAM disks
;"NoDriveTypeAutoRun"=dword:0x00000048

;Disables Autoplay on fixed drives and unknown drives
;"NoDriveTypeAutoRun"=dword:0x00000089

;Disables Autoplay on network drives and CD-ROM drives
;"NoDriveTypeAutoRun"=dword:0x00000030

;Disables Autoplay on network drives and RAM disks
;"NoDriveTypeAutoRun"=dword:0x00000050

;Disables Autoplay on network drives and unknown drives
;"NoDriveTypeAutoRun"=dword:0x00000091

;Disables Autoplay on CD-ROM drives and RAM disks
;"NoDriveTypeAutoRun"=dword:0x00000060

;Disables Autoplay on CD-ROM drives and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000a1

;Disables Autoplay on RAM disks and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000c1

;Disables Autoplay on removable drives, fixed drives and network drives
;"NoDriveTypeAutoRun"=dword:0x0000001c

;Disables Autoplay on removable drives, fixed drives and CD-ROM drives
;"NoDriveTypeAutoRun"=dword:0x0000002c

;Disables Autoplay on removable drives, fixed drives and RAM disks
;"NoDriveTypeAutoRun"=dword:0x0000004c

;Disables Autoplay on removable drives, fixed drives and unknown drives
;"NoDriveTypeAutoRun"=dword:0x0000008d

;Disables Autoplay on removable drives, network drives and CD-ROM drives
;"NoDriveTypeAutoRun"=dword:0x00000034

;Disables Autoplay on removable drives, network drives and RAM disks
;"NoDriveTypeAutoRun"=dword:0x00000054

;Disables Autoplay on removable drives, network drives and unknown drives
;"NoDriveTypeAutoRun"=dword:0x00000095

;Disables Autoplay on removable drives, CD-ROM drives and RAM disks
;"NoDriveTypeAutoRun"=dword:0x00000064

;Disables Autoplay on removable drives, CD-ROM drives and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000a4

;Disables Autoplay on removable drives, RAM disks and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000c5

;Disables Autoplay on fixed drives, network drives and CD-ROM drives
;"NoDriveTypeAutoRun"=dword:0x00000038

;Disables Autoplay on fixed drives, network drives and RAM disks
;"NoDriveTypeAutoRun"=dword:0x00000058

;Disables Autoplay on fixed drives, network drives and unknown drives
;"NoDriveTypeAutoRun"=dword:0x00000099

;Disables Autoplay on fixed drives and CD-ROM drives and RAM disks
;"NoDriveTypeAutoRun"=dword:0x00000068

;Disables Autoplay on fixed drives, CD-ROM drives and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000a9

;Disables Autoplay on fixed drives, RAM disks and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000c9

;Disables Autoplay on network drives, CD-ROM drives and RAM disks
;"NoDriveTypeAutoRun"=dword:0x00000070

;Disables Autoplay on network drives, CD-ROM drives and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000b1

;Disables Autoplay on network drives, RAM disks and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000d1

;Disables Autoplay on CD-ROM drives, RAM disks and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000e1

;Disables Autoplay on removable drives, fixed drives, network drives and CD-ROM drives
;"NoDriveTypeAutoRun"=dword:0x0000003c

;Disables Autoplay on removable drives, fixed drives, network drives and RAM disks
;"NoDriveTypeAutoRun"=dword:0x0000005c

;Disables Autoplay on removable drives, fixed drives, network drives and unknown drives
;"NoDriveTypeAutoRun"=dword:0x0000009d

;Disables Autoplay on removable drives, fixed drives, CD-ROM drives and RAM disks
;"NoDriveTypeAutoRun"=dword:0x0000006c

;Disables Autoplay on removable drives, fixed drives, CD-ROM drives and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000ad

;Disables Autoplay on removable drives, fixed drives, RAM disks and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000cd

;Disables Autoplay on removable drives, network drives, CD-ROM drives and RAM disks
;"NoDriveTypeAutoRun"=dword:0x00000074

;Disables Autoplay on removable drives, network drives, CD-ROM drives and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000b5

;Disables Autoplay on removable drives, network drives, RAM disks and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000d5

;Disables Autoplay on removable drives, CD-ROM drives, RAM disks and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000e5

;Disables Autoplay on fixed drives, network drives, CD-ROM drives and RAM disks
;"NoDriveTypeAutoRun"=dword:0x00000078

;Disables Autoplay on fixed drives, network drives, CD-ROM drives and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000b9

;Disables Autoplay on fixed drives, network drives, RAM disks and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000d9

;Disables Autoplay on fixed drives, CD-ROM drives, RAM disks and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000e9

;Disables Autoplay on network drives, CD-ROM drives, RAM disks and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000f1

;Disables Autoplay on removable drives, fixed drives, network drives, CD-ROM drives and RAM disks
;"NoDriveTypeAutoRun"=dword:0x0000007c

;Disables Autoplay on removable drives, fixed drives, network drives, CD-ROM drives and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000bd

;Disables Autoplay on removable drives, fixed drives, network drives, RAM disks and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000dd

;Disables Autoplay on removable drives, fixed drives, CD-ROM drives, RAM disks and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000ed

;Disables Autoplay on removable drives, network drives, CD-ROM drives, RAM disks and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000f5

;Disables Autoplay on fixed drives, network drives, CD-ROM drives, RAM disks and unknown drives
;"NoDriveTypeAutoRun"=dword:0x000000f9

Comentários