|
|
||||||
|
#1
|
|
|
|
|
Hello,
I have a couple of .WSF files that work properly under Win32. These files reference Msxml2.DOMDocument.4.0 object. Under Win64 WSH refuses to run the script with the error: Windows Script Host: Cannot find the type library for this reference : Msxml2.DOMDocument.4.0 When I run a file with 32-bit WSH host explicitly (via %WINDIR%\SysWOW64\Cscript.exe), then everything works fine. Here's the example .WSF file: ------- XmlTest.wsf ------- <job id="main"> <?job debug="true"?> <reference object="Msxml2.DOMDocument.4.0" /> <object id="xmlDoc" progid="Msxml2.DOMDocument.4.0" /> <script language="JScript"> </script> </job> --------------------------- I don't want to specify 32-bit explicitly every time. What should I do in order to run this script under Win64? Thanks in advance Alex |
|
|
|
#2
|
|
|
|
|
"Alex Blekhman" wrote:
> I don't want to specify 32-bit explicitly every time. What > should I do in order to run this script under Win64? OK, I found that MSXML 4.0 does not exist under 64-bit Windows. I need to move to MSXML 6.0 or fall back to MSXML 3.0, which exist in both flavours of Windows. Alex |
|
#3
|
|
|
|
|
>
> OK, I found that MSXML 4.0 does not exist under 64-bit Windows. I > need to move to MSXML 6.0 or fall back to MSXML 3.0, which exist > in both flavours of Windows. > ...Or just associate .vbs files with the 32-bit version of WScript.exe permanently. If you want to run 64-bit (with no particular benefit) you're going to be limited in what you can use. Most 64-bit Windows software also exists in 32-bit. Most 32-bit software -- from anyone -- does not exist in 64-bit. |
|
#4
|
|
|
|
|
"mayayana" wrote:
> ...Or just associate .vbs files with the 32-bit version of > WScript.exe permanently. If you want to run 64-bit (with no > particular benefit) you're going to be limited in what you can > use. I want to run it regardless of the Windows version. These scripts may be used by any member of our team on a variety of PC boxes: from 32-bit XP to 64-bit 2008 Server. That's why it is important for me to make the execution transparent for a user. Alex |
|
#5
|
|
|
|
|
> I want to run it regardless of the Windows version. These scripts
> may be used by any member of our team on a variety of PC boxes: > from 32-bit XP to 64-bit 2008 Server. That's why it is important > for me to make the execution transparent for a user. > I don't think you have much choice. 1) You can set all PCs to default to wscript (or cscript) 32-bit. (Then you can set them back in 2018 when 64-bit becomes relevant. :) 2) You can write the scripts to adapt to the system. That means that on 64-bit you'll never be able to use any objects except those Microsoft objects that come in 64-bit. I don't know offhand how you identify 64-bit via script. But if you use method #2 you'd have to do that, essentially having dual scripts that fork to separate routines once the system version has been ascertained. |
|
#6
|
|
|
|
|
"mayayana" wrote:
> That means that on 64-bit you'll never be able to use any > objects except those Microsoft objects that come in 64-bit. I am perfectly fine with this. My question was not about any ActiveX object in general, but specifically about MSXML object. MSXML 6.0 is available on all version of Windows used in our team. Thanks Alex |
|
#7
|
|
|
|
|
"Alex Blekhman" <tkfx.REMOVE> wrote in message
news:2076 > Hello, > > I have a couple of .WSF files that work properly under Win32. These files > reference Msxml2.DOMDocument.4.0 object. Under Win64 WSH refuses to run > the script with the error: > > Windows Script Host: Cannot find the type library for this reference : > Msxml2.DOMDocument.4.0 > > When I run a file with 32-bit WSH host explicitly (via > %WINDIR%\SysWOW64\Cscript.exe), then everything works fine. Have you tried not explicitly specifying the version and letting windows choose the active version? <reference object="Msxml2.DOMDocument" /> <object id="xmlDoc" progid="Msxml2.DOMDocument" /> |
|
#8
|
|
|
|
|
"James Whitlow" wrote:
> Have you tried not explicitly specifying the version and > letting windows choose the active version? > > <reference object="Msxml2.DOMDocument" /> > <object id="xmlDoc" progid="Msxml2.DOMDocument" /> The problem is that versionless declaration defaults to MSXML 3.0. For my script I need at least version 4.0 - some of the features I use are available only in version 4.0 and higher. Thanks Alex |
|
#9
|
|
|
|
|
"Alex Blekhman" <tkfx.REMOVE> wrote in message
news:5940 > "James Whitlow" wrote: >> Have you tried not explicitly specifying the version and letting windows >> choose the active version? >> >> <reference object="Msxml2.DOMDocument" /> >> <object id="xmlDoc" progid="Msxml2.DOMDocument" /> > > The problem is that versionless declaration defaults to MSXML 3.0. For my > script I need at least version 4.0 - some of the features I use are > available only in version 4.0 and higher. You might consider trapping the error & then checking the variable type. If the object is successfully instantiated, you should have an 'object' variable type. If you don't, try the other version. I write in VBScript, so I am not sure how to do it in JavaScript. Also, I don't have a 64-bit version of Windows, but my 32-bit version of XP has the 6.0 version of MSXML installed. I don't remember explicitly doing this, so I assume it go installed with a Service Pack or security patch. If this is true of your workstations, you could try the 6.0 on the 32-bit versions of Windows to see if it works as expected. |
|
#10
|
|
|
|
|
"James Whitlow" wrote:
> Also, I don't have a 64-bit version of Windows, but my 32-bit > version of XP has the 6.0 version of MSXML installed. I don't > remember explicitly doing this, so I assume it go installed with > a Service Pack or security patch. If this is true of your > workstations, you could try the 6.0 on the 32-bit versions of > Windows to see if it works as expected. This is exactly what I did as I described in my other post. Now my script uses MSXML 6.0 by default. This version of MSXML is available on all our workstations. I comes with many MS products by default. Thanks Alex |
|
|
| Similar Threads | |
| Running scripts? Can someome please tell me how I can avoid getting a pop up box everytime I click on an email in my inbox that says "An error has occurred on the scipt on this page. Do you... |
|
| o2 XDA Exec/MDA PRO/JAR JAR and SPV M5000. Running under Win64 Bit Could somebody please help me. I cannot get my PPC o2 XDA Exec to hot sync with my PC (running win 64 bit AMD) the ppc is using mobile 2005 and i have install activesync... |
|
| scripts not running on one of 2 dc I have a windows 2000 domain controller and a window 2003 domain controller. Both are catalog servers. When users authenticate to the W2k dc, the scripts that are set at the... |
|
| Running scripts The check box for running scripts and programs is greyed out (this is in folder properties) how do I enable it to create a folder to run scripts. |
|
| running SQL scripts. What is the best way to run a .sql script on a database? Do I need a special tool? Thanks, David |
|
|
All times are GMT. The time now is 04:20 PM. | Privacy Policy
|