From: Shucheng Liu Shucheng on
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"

MSDN 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?
From: mayayana on
Is it only a problem on 64-bit? If so you might
try switching the .vbs extension to point to the
32-bit version of wscript.exe (in the folder with
the confusing name of "SysWOW64").

32-bit components won't work with 64-bit wscript.
The 64-bit version seems to be the default on 64-bit
systems.
But at this point there's hardly any 64-bit
software of any kind, outside of Microsoft's OS and
pre-installed applets. And they all seem to have 32-bit
versions. So there really isn't much point in using
64-bit anything, that I can see, for the forseeable future.


--
--
Shucheng Liu <Shucheng Liu(a)discussions.microsoft.com> wrote in message
news:3D342321-4CAF-45D6-B88B-D6500C212390(a)microsoft.com...
> 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"
>
> MSDN 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?


From: Shucheng Liu on
Thank you!!! Yes, the script will run well when we use that
SysWOW64/wscript.exe in commond line. But now we have another problem:
Our script will run automatically when user logo his computer, and it will
call Capicom with the system default wscript.exe as following:
Set store = CreateObject("Capicom.Store")
store.Open 2,"MY",130
So how can we set the SysWOW64/wscript.exe as system default wscript.exe, or
set our script to be run by that wscript?

"mayayana" wrote:

> Is it only a problem on 64-bit? If so you might
> try switching the .vbs extension to point to the
> 32-bit version of wscript.exe (in the folder with
> the confusing name of "SysWOW64").
>
> 32-bit components won't work with 64-bit wscript.
> The 64-bit version seems to be the default on 64-bit
> systems.
> But at this point there's hardly any 64-bit
> software of any kind, outside of Microsoft's OS and
> pre-installed applets. And they all seem to have 32-bit
> versions. So there really isn't much point in using
> 64-bit anything, that I can see, for the forseeable future.
>
>
> --
> --
> Shucheng Liu <Shucheng Liu(a)discussions.microsoft.com> wrote in message
> news:3D342321-4CAF-45D6-B88B-D6500C212390(a)microsoft.com...
> > 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"
> >
> > MSDN 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?
>
>
> .
>
From: mayayana on
> So how can we set the SysWOW64/wscript.exe as system default wscript.exe,
or
> set our script to be run by that wscript?

I haven't used a 64-bit system, but I think it should
work to change the file association for .vbs files
In the Registry.
The way it works is that file extensions are listed
in HKCR:
HKCR\.vbs

The default value there should be something like "VBSFile".
You then look up HKCR\VBSFile\Shell\Open\Command\

That key will hold the command line used for the file type.
You should be able to just point that value at the 32-bit WScript.

>
> "mayayana" wrote:
>
> > Is it only a problem on 64-bit? If so you might
> > try switching the .vbs extension to point to the
> > 32-bit version of wscript.exe (in the folder with
> > the confusing name of "SysWOW64").
> >
> > 32-bit components won't work with 64-bit wscript.
> > The 64-bit version seems to be the default on 64-bit
> > systems.
> > But at this point there's hardly any 64-bit
> > software of any kind, outside of Microsoft's OS and
> > pre-installed applets. And they all seem to have 32-bit
> > versions. So there really isn't much point in using
> > 64-bit anything, that I can see, for the forseeable future.
> >
> >
> > --
> > --
> > Shucheng Liu <Shucheng Liu(a)discussions.microsoft.com> wrote in message
> > news:3D342321-4CAF-45D6-B88B-D6500C212390(a)microsoft.com...
> > > 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"
> > >
> > > MSDN 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?
> >
> >
> > .
> >


From: Shucheng Liu on
We solved the problem by following your steps. Thank you! If possible, would
you please look into another problem in this discussion group:
why IE is shown when navigating a HTTPS URL in VBS script on windows7

Anyway, Thank you again:)


"mayayana" wrote:

> > So how can we set the SysWOW64/wscript.exe as system default wscript.exe,
> or
> > set our script to be run by that wscript?
>
> I haven't used a 64-bit system, but I think it should
> work to change the file association for .vbs files
> In the Registry.
> The way it works is that file extensions are listed
> in HKCR:
> HKCR\.vbs
>
> The default value there should be something like "VBSFile".
> You then look up HKCR\VBSFile\Shell\Open\Command\
>
> That key will hold the command line used for the file type.
> You should be able to just point that value at the 32-bit WScript.
>
> >
> > "mayayana" wrote:
> >
> > > Is it only a problem on 64-bit? If so you might
> > > try switching the .vbs extension to point to the
> > > 32-bit version of wscript.exe (in the folder with
> > > the confusing name of "SysWOW64").
> > >
> > > 32-bit components won't work with 64-bit wscript.
> > > The 64-bit version seems to be the default on 64-bit
> > > systems.
> > > But at this point there's hardly any 64-bit
> > > software of any kind, outside of Microsoft's OS and
> > > pre-installed applets. And they all seem to have 32-bit
> > > versions. So there really isn't much point in using
> > > 64-bit anything, that I can see, for the forseeable future.
> > >
> > >
> > > --
> > > --
> > > Shucheng Liu <Shucheng Liu(a)discussions.microsoft.com> wrote in message
> > > news:3D342321-4CAF-45D6-B88B-D6500C212390(a)microsoft.com...
> > > > 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"
> > > >
> > > > MSDN 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?
> > >
> > >
> > > .
> > >
>
>
> .
>