Re: Updated: Error on Win2K Server
- From: "Paul" <paulw_win@xxxxxxxxx>
- Date: Fri, 29 Sep 2006 09:24:23 +0800
Hi
I received this one on Win2K Servers.
Microsoft (R) Windows Script Host Version 5.1 for Windows
Copyright (C) Microsoft Corporation 1996-1999. All rights reserved.
D:\wmilocal.js(3, 1) SWbemLocator: Server execution failed
object is returned under WinXP and Win2003 Server.
"Gerry Hickman" <gerry666uk@xxxxxxxxxxxxxxxx> wrote in message
news:el8P5k04GHA.3732@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
Please try this script to test your win2k servers, save it as wmilocal.js
and run it using CScript at a CMD prompt like this
CScript wmilocal.js
// wmilocal.js
var oLoc = new ActiveXObject("WbemScripting.SWbemLocator");
var oSvc = oLoc.ConnectServer(".", "root\\cimv2");
WScript.Echo(typeof oSvc);
oSvc = null;
oLoc = null;
Paul wrote:
This problem occured on all Win2K servers (Domain Controller and Member
Server) but NO problem with Win2003 Server (Member Server) and WinXP
terminal. Why was it so ? Seemingly the older OS got problem with it. Any
solution ?
"Paul" <paulw_win@xxxxxxxxx> wrote in message
news:Oz0025p4GHA.4820@xxxxxxxxxxxxxxxxxxxxxxx
I wrote a procedure in Visual Foxpro as below. It runs well under WinXP
but failed on the Win2K Server with Service Pack 4 installed.
objLocator = CREATEOBJECT("WBEMScripting.SWBEMLocator")
objService = objLocator.ConnectServer
objService.Security_.ImpersonationLevel=3
objcolInstalledPrinters = objService.ExecQuery("SELECT * FROM
Win32_Printer")
FOR EACH objPrinter IN objcolInstalledPrinters
MESSAGEBOX(objPrinter.DeviceID)
ENDFOR
The first line is ok. The second line caused
The error following error message appears
OLE |Dispatch exception code 0 from SWbemlocator: Server excution failed
I'd then changed it to objService =
objLocator.ConnectServer(".","root\cimV2"), still the same. Indeed,
what's wrong with Win2K server ? How come no problem on WinXP ? Thanks.
--
Gerry Hickman (London UK)
.
- Follow-Ups:
- Re: Updated: Error on Win2K Server
- From: Gerry Hickman
- Re: Updated: Error on Win2K Server
- References:
- Re: Updated: Error on Win2K Server
- From: Gerry Hickman
- Re: Updated: Error on Win2K Server
- Prev by Date: Re: Updated: Error on Win2K Server
- Next by Date: Re: Remotely execute programs/exe
- Previous by thread: Re: Updated: Error on Win2K Server
- Next by thread: Re: Updated: Error on Win2K Server
- Index(es):
Relevant Pages
|