如何在Windows7 x64的VBS脚本中使用/替换Capicom? [英] How to Use/Replace Capicom in VBS script on Windows7 x64?

查看:66
本文介绍了如何在Windows7 x64的VBS脚本中使用/替换Capicom?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 我们有一个项目,该项目在VBS脚本中调用Capicom.dll,以从本地计算机和Active Directory存储中获取/添加/删除证书,如下所示:
-------------- -------------------------------------------------- ----------------
   设置store = CreateObject("Capicom.Store") 
   打开2,"MY",130 
       如果错误编号> 0然后
           记录错误:发现错误:Vbscript错误:" &错误编号" &错误说明-***
       其他
           日志"错误:找到CAPICOM错误:" &错误编号" &错误说明
       如果结束
       错误清除
        WScript.Quit
   如果结束

   对于商店中的每个证书.证书
    ....
------------------------------------------ --------------------------------------
 该脚本在2003年运行良好/XP/2008/Vista等.现在,有些客户希望使用Windows7 x64,但不建议使用Capicom.dll.我们在Windows 7 x64上以2008服务器x32作为AD尝试了该脚本,将在行"***"处抛出错误.并显示错误:发现错误:Vbscript错误:424个对象"

您的文档建议按以下方式替换Capicom.dll:http://msdn.microsoft.com/zh-cn/library/cc778518 %28VS.85%29.aspx
但这对用户来说非常不便,看来此替代解决方案只能支持x509证书,并且只能从本地计算机获取/添加/删除证书,但不能.没有任何全面解决方案可以满足我们的要求从本地计算机和Active Directory存储区中的VBS脚本中获取/添加/删除证书".

顺便说一句,如果我们在Windows7 x64上的VbsEdit中运行脚本,那么它就可以很好地工作... 

  We have a project that call Capicom.dll in a VBS script to fetch/add/delete certs from both local computer and Active Directory stores, as following:
--------------------------------------------------------------------------------
    Set store = CreateObject("Capicom.Store")  
    store.Open 2,"MY",130 
        If Err.Number > 0 Then
            log "Error:Vbscript error found:" & Err.Number &" " & Err.Description       --Line ***
        Else
            log "Error:CAPICOM error found : " & Err.Number &" " & Err.Description
        End If
        Err.Clear
        WScript.Quit
    End If

    For each certificate in store.Certificates
    ....
--------------------------------------------------------------------------------
 The script works well for 2003/XP/2008/Vista and so on. Now some customers want to use Windows7 x64 but Capicom.dll is deprecated for it. We tried the script on windows7 x64 with a 2008 server x32 as AD, An error will throw at line "***" with saying "Error:Vbscript error found:424 Object Required"

Your document suggests to replace Capicom.dll as following: http://msdn.microsoft.com/en-us/library/cc778518%28VS.85%29.aspx
But it's so inconvenient for user, and seems this alternative solution can only support x509 cert, and can only fetch/add/delete certs from local computer, but NOT AD... Is there any total solution that can address our requirement "fetch/add/delete certs in a VBS script from both local computer and Active Directory stores" for Windows7 x64?

BTW, if we run our script in VbsEdit on Windows7 x64 then it works well...  How can VbsEdit do this?

推荐答案

该论坛适用于VB.net,而不是VBS,请尝试此链接http://social.msdn.microsoft.com/Forums/en/isvvba/threads
This forum is for VB.net not VBS try this link http://social.msdn.microsoft.com/Forums/en/isvvba/threads


这篇关于如何在Windows7 x64的VBS脚本中使用/替换Capicom?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆