“设置”>“设备”>“自动播放”>“可移动驱动器”的注册表位置在哪里

莎拉·温伯格(Sarah Weinberger)

Settings > Devices > AutoPlay > "Removable drive"选项的用户特定设置,注册表位置在哪里(大概在HKEY_CURRENT_USER下)

Windows设置设备自动播放选项

用户可以选择:

  • 不采取行动
  • 打开文件夹以查看文件(文件资源管理器)//默认设置
  • 导入照片和视频(Dropbox)
  • 每次问我
  • 配置存储设置(设置)

如果该设置位于注册表之外的其他地方,那在哪里?基本上,我想以编程方式配置此选项。我在这里提出问题的原因是,我已经知道如何使用注册表和文件系统。我只需要知道在哪里,因此更多是关于超级用户的问题。是的,我的第一个想法是在Stack Overflow上发帖,但是我不问编程问题,尽管我会使用C#进行编程,因为我知道那部分。我被困在实际位置上。

管理员(或用户)可以启用/禁用自动播放策略的另一个区域是gpedit.msc基本上,运行(Windows键+ R)gpedit.msc启动Local Group Policy Editor从那里选择

本地计算机策略>用户配置>管理模板> Windows组件>自动播放策略

gpedit.msc显示自动播放策略

This avenue seems more complicated, but a possibility. Still, I would need to know where this setting is physically (I presume the registry as well).

I want to be able to programmatically, hence the "where", to temporarily disable launching File Explorer or take any other action on drives (USB, SATA, whatever) and then set the setting back to the original value once my task completes.

Just to be complete on all the areas, where a user can set AutoPlay settings, the traditional Control Panel is the third way. I am doing research on my problem and ran into this way. A user would go to the Windows Control Panel and select the View by Small Icons from the category dropdown and then select AutoPlay. I already found out via testing that setting the value in Settings automatically updates the Control Panel area. That means that both read from the same location dynamically, which I would presume is the registry.

Windows控制面板自动播放设置

UPDATE:

I saw this article, which states the registry entry NoDriveTypeAutoRun in the following key, but that has no effect on my Windows 10 Professional X64 system with all the latest updates. I changed the value in Settings and refreshed the registry to see no change.

HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explore

UPDATE 2

I found this article on how to disable AutoPlay programmatically. The article, although a programming topic, does answer my question, namely that the registry setting that I mentioned above, takes effect only after restarting Windows Explorer (logging off and then back on).

This article does indeed require a restart of Explorer, HOWEVER there is definitely an answer, as selecting a new option in Control Panel AutoPlay or the Settings/Devices/AutoPlay area is IMMEDIATE with no restart of Explorer. As such, there is a solution.

Maybe the solution is to write in 2 places: HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER. Whatever Settings does behind the scenes is what I wish to do, just I do not know what the Microsoft applet does.

ANSWER:

Based on the method exposed by the accepted answer, I got these two registry values.

Open Folder                     
39:21.9 SystemSettings.exe  13908   RegSetValue HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\UserChosenExecuteHandlers\StorageOnArrival\(Default)   SUCCESS Type: REG_SZ, Length: 26, Data: MSOpenFolder
    MSOpenFolder                    
39:21.9 SystemSettings.exe  13908   RegSetValue HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlersDefaultSelection\StorageOnArrival\(Default)   SUCCESS Type: REG_SZ, Length: 26, Data: MSOpenFolder
    MSOpenFolder                    

Take No Action                      
41:43.7 SystemSettings.exe  13908   RegSetValue HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\UserChosenExecuteHandlers\StorageOnArrival\(Default)   SUCCESS Type: REG_SZ, Length: 30, Data: MSTakeNoAction
    MSTakeNoAction                  
41:43.7 SystemSettings.exe  13908   RegSetValue HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlersDefaultSelection\StorageOnArrival\(Default)   SUCCESS Type: REG_SZ, Length: 30, Data: MSTakeNoAction
    MSTakeNoAction                  
Biswapriyo

Where is the registry location for the Settings > Devices > AutoPlay > "Removable drive" option?

tl;dr: The registry location is:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers 
  • How to find the registry change? Here I use Process Monitor to monitor the registry change. Run Process Monitor (aka. ProcMon) as administrator → Press Ctrl+L to open Filter dialog box → Choose the filter options as "Operation --- is --- RegSetValue --- then --- include" → then Add button → OK. The screenshot is as follows:

ProcMon_RegSetValue

  • The registry settings are listed below. This format is a Windows Registry file:
Windows Registry Editor Version 5.00

;Disable AutoPlay
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers]
"DisableAutoplay"=dword:1

;Take No Action
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlersDefaultSelection\CameraAlternate\ShowPicturesOnArrival]
@="MSTakeNoAction"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlersDefaultSelection\StorageOnArrival]
@="MSTakeNoAction"

;Open folder to view files (File Explorer)
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlersDefaultSelection\CameraAlternate\ShowPicturesOnArrival]
@="MSOpenFolder"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlersDefaultSelection\StorageOnArrival]
@="MSOpenFolder"

;Ask me every time
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlersDefaultSelection\CameraAlternate\ShowPicturesOnArrival]
@="MSPromptEachTime"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlersDefaultSelection\StorageOnArrival]
@="MSPromptEachTime"

;Configure storage settings (Settings)
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlersDefaultSelection\CameraAlternate\ShowPicturesOnArrival]
@="MSStorageSense"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlersDefaultSelection\StorageOnArrival]
@="MSStorageSense"

这些注册表设置可以在C / C ++RegSetValue()或C#中轻松转换RegistryKey.SetValue MethodDropbox选项由该程序本身处理。如上所述,用ProcMon查找那些注册表。本文中查看更多详细信息

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

视频自动播放在Safari和Chrome桌面浏览器中不起作用

移动浏览器上的“自动播放” HTML5音频播放器

音频标签自动播放在移动设备中不起作用

Chrome 64移动版Android无法预加载并且无法自动播放静音的视频

Safari阻止自动播放video.js播放器

视频自动播放器

youtube嵌入式url设置无法自动播放视频

在移动浏览器上自动播放视频元素

可以将MediaElement设置为自动播放视频文件吗?

连接MTP设备后如何禁用自动播放功能?

我正在尝试让音乐播放器自动播放

为什么我的嵌入式YouTube播放器无法自动播放?

在移动设备上自动播放HTML视频

禁止在Google Chrome浏览器中自动播放?

即使所有自动播放设置均已关闭,视频自动播放仍会发生(Firefox Normandy)

自动播放无法在移动浏览器上工作

如何通过YouTube播放器自动播放视频

如何在移动设备上自动开始播放音频?

自动设置可移动驱动器上的文件夹图标?

使用注册表禁用音频 CD 和 USB 驱动器的自动播放

自动播放从数据库中检索位置的视频

当设备上不允许自动播放时,用背景图像替换背景视频

谷歌浏览器不会自动播放视频

在移动设备上停止 HTML 视频自动播放

当自动播放设置为 true 并且无限设置为 false 时,防止光滑的滑块向后移动

HLS / 媒体源扩展 <video> 静音和自动播放在移动设备上的第一帧冻结

Mapbox 设置设备位置

当 URL 加载到播放器时如何自动播放视频?

firefox 移动自动播放静音