在Windows 10中,如果右键单击图像,则会找到一个名为“共享”的选项。
单击此按钮将打开一个对话框,您可以在其中通过电子邮件,一个便笺等共享图像
有谁知道我该如何从CMD或PowerShell调用它?因为我想将此功能添加到我的应用中。
我已经到了这一点,但是得到了无效的窗口句柄错误:
$Target = "C:\Users\igweo\OneDrive\Pictures\wallpapers\luca-zanon-26595-unsplash.jpg"
$KeyPath1 = "HKCU:\SOFTWARE\Classes"
$KeyPath2 = "*"
$KeyPath3 = "shell"
$KeyPath4 = "{:}"
$ValueName = "ExplorerCommandHandler"
$ValueData = (Get-ItemProperty("HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\" +
"Explorer\CommandStore\shell\Windows.ModernShare")).ExplorerCommandHandler
$Key2 = (Get-Item $KeyPath1).OpenSubKey($KeyPath2, $true)
$Key3 = $Key2.CreateSubKey($KeyPath3, $true)
$Key4 = $Key3.CreateSubKey($KeyPath4, $true)
$Key4.SetValue($ValueName, $ValueData)
$Shell = New-Object -ComObject "Shell.Application"
$Folder = $Shell.Namespace((Get-Item $Target).DirectoryName)
$Item = $Folder.ParseName((Get-Item $Target).Name)
$Item.InvokeVerb("{:}")
$Key3.DeleteSubKey($KeyPath4)
if ($Key3.SubKeyCount -eq 0 -and $Key3.ValueCount -eq 0) {
$Key2.DeleteSubKey($KeyPath3)
}
Run Code Online (Sandbox Code Playgroud)
另外,使用RUNDLL也不起作用:
RUNDLL32.EXE NTSHRUI.DLL,ShowShareFolderUI C:\Users\igweo\OneDrive\Pictures\wallpapers\luca-zanon-26595-unsplash.jpg
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 Windows 注册表中的 shellbag 构建一个小型应用程序。我正在尝试解码表单中的一些数据REG_BINARY
,但不知道从哪里开始。如果你去:
Computer\HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\Shell\BagMRU\0
您会发现一系列值,0、1、2、3 等类型REG_BINARY
,打开它们有时会显示似乎是一个文件夹的内容以及大量看似乱码的内容。
我还需要了解以下形式的键的二进制列 ('Sort'
和):'Colinfo'
Computer\HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\Shell\Bags\1\Shell\{5C4F28B5-F869-4E84-8E60-F11DB97C5CC7}
我尝试在网上查看 shellbags python 程序,但老实说,我不知道它们在做什么,而且它们似乎是用 python2 编写的,所以没有骰子。
我已经编写了一个小的 python 程序来提供帮助,但它缺少获取节点槽的方法,并且我正在尝试将任何给定的文件夹名称链接到节点槽。这是我目前的程序。
from winreg import *
from codecs import decode
folder_reg_path = "Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\Shell\\Bags\\1375\\Shell"
bags_mru_path = "Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagMRU"
def get_sniffed_folder_type(reg_key):
with OpenKey(HKEY_CURRENT_USER, reg_key) as key:
value = QueryValueEx(key, 'SniffedFolderType')
return '%s' % (value[0])
def get_current_nodeid(reg_key):
with OpenKey(HKEY_CURRENT_USER, reg_key, 0, KEY_READ) as key:
#value = QueryValueEx(key, '0')
#return value[0].hex().decode('utf-8')
value = EnumValue(key, 2)
return …
Run Code Online (Sandbox Code Playgroud)