源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

Powershell从注册表中查询默认MAPI客户端的例子

  • 时间:2020-08-20 15:16 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:Powershell从注册表中查询默认MAPI客户端的例子
当你通过类似Mailto:链接发送邮件,此时邮件客户端就是MAPI客户端。如果要找出到这个MAPI客户端在哪里,这里有个函数能从注册表中获得该信息。
[u]复制代码[/u] 代码如下:
functionGet-MAPIClient {     functionRemove-Argument     {       param       (         $CommandLine       )       $divider=''if ($CommandLine.StartsWith('"'))       {         $divider='"'$CommandLine=$CommandLine.SubString(1)       }       $CommandLine.Split($divider)[0]     }   $path='Registry::HKEY_CLASSES_ROOT\mailto\shell\open\command'# create new object to return values $returnValue=1|Select-Object-PropertyHasMapiClient,Path,MailTo$returnValue.hasMAPIClient=Test-Path-Path$pathif ($returnValue.hasMAPIClient)   {     $values=Get-ItemProperty-Path$path$returnValue.MailTo=$values.'(default)'$returnValue.Path=Remove-Argument$returnValue.MailToif ((Test-Path-Path$returnValue.Path) -eq$false)     {       $returnValue.hasMAPIClient=$true     }   }       $returnValue } Get-MAPIClient
执行后的结果类似: [img]http://files.jb51.net/file_images/article/201405/201457101001021.png?201447101040[/img] 举一反三,同样也可以修改代码查询其它类型的默认客户端。
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部