0
I want to add a few lines to a script with the capacity to enable/disable the Autorun feature.
It's not a new concept. It's been covered countless times before, including here on StackExchange, and here by Microsoft.
The general consensus is, it's achieved by modifying the values of the following registry keys:
HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDriveTypeAutorun
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDriveTypeAutorun
This worked for me in the past with Windows7 (Ultimate/Professional), but these registry keys don't appear to be present on Windows10 (Enterprise). Is this normal? Have they been superseded?
I did a search for related keywords and found the following that seem like they could be relevant.
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\DisableAutoplay
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlersDefaultSelection\AutorunINFLegacyArrival\
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\UserChosenExecuteHandlers\AutorunINFLegacyArrival\
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\AutorunINFLegacyArrival\
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\MSAutoRun\
HKLM\SOFTWARE\Microsoft\PolicyManager\default\Autoplay\DisallowAutoplayForNonVolumeDevices
HKLM\SOFTWARE\Microsoft\PolicyManager\default\Autoplay\SetDefaultAutoRunBehavior
HKLM\SOFTWARE\Microsoft\PolicyManager\default\Autoplay\TurnOffAutoPlay
HKLM\SYSTEM\CurrentControlSet\Services\cdrom\
HKLM\SYSTEM\CurrentControlSet\Services\Disk\
HKLM\SYSTEM\CurrentControlSet\Services\sfloppy\
If I just add it manually, will it have the desired effect? – voices – 2018-11-25T19:38:03.867
Yes that should work, most Group Policies literally just set a registry key. In my case Autorun got disabled immediately (no restart of explorer or Windows required) – User025 – 2018-11-25T19:50:11.740
Worth pointing out that some group policies only work on certain editions. So changing the associated registry key would not work in a case where the group policy wasn't applicable to the edition you are using. However, that isn't the case with this particular policy, but worth pointing out if you are trying to set group policies through the registry. – Ramhound – 2018-11-28T14:34:04.347
@Ramhound Are there any Group Policies that wont work in the Enterprise version of Windows? Thought they would all work for that version so I didn't mention that. – User025 – 2018-11-28T16:17:03.953
@User025 - There are indeed group policies that are ignored if enabled on Windows 10 Professional and are only applicable to Windows 10 Enterprise. Please read my original comment again. – Ramhound – 2018-11-28T16:23:10.210
I found this page: https://www.top-password.com/blog/4-ways-to-disable-windows-10-autoplay/ that says to set
– voices – 2018-11-29T02:51:20.987HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\DisableAutoplay
to1
/0
. Weird.Hmm it seems like that registry value is the one used by the modern Windows 10 settings app. If you go into Devices -> AutoPlay and use the toggle switch to fully disable / enable AutoPlay this value will be used (disabling AutoPlay sets the value to 1 for me and enabling it again deletes the key), will edit my answer to reflect this – User025 – 2018-11-29T16:45:39.510