H
haai
Hi
The problem that I have is a little difficult to explain, but I'll try
as good as possible ;-)
First, I create a scheduled task with a WMI-script on all computers in
the network. A little code I use for it:
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & txtcomp & "\root\cimv2")
Set objNewJob = objWMIService.Get("Win32_ScheduledJob")
errJobCreated = objNewJob.Create ....
This works fine, and the scheduled script is listed in the "scheduled
tasks" of windows.
The scheduled task is \\myserver\myshare\myscript.vbs
At the second step, when the scheduled script will be executed, I get
an error (see below). The strange thing is, I only get this error on
some computers. On other computers in the network it works perfect.
There is no difference between W2K and XP.
Another strange thing: when I execute the script manually on the
computers where it fails, the script works fine! Also, when the task is
scheduled, and I change the "run as"-field in the properties to a
domain account, it works fine.
The problem is something with the "system"-account I think. (But it is
strange it works on some computers fine, and on others not).
Anyone a suggestion?
Thx in advance
Mathias
The error is raised at the following line:
Set objexplorer = wscript.CreateObject("InternetExplorer.Application",
"objexplorer_")
The error is "ActiveX component can't create object". With an error
resume next, the next (logical) error is "object required".
The problem that I have is a little difficult to explain, but I'll try
as good as possible ;-)
First, I create a scheduled task with a WMI-script on all computers in
the network. A little code I use for it:
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & txtcomp & "\root\cimv2")
Set objNewJob = objWMIService.Get("Win32_ScheduledJob")
errJobCreated = objNewJob.Create ....
This works fine, and the scheduled script is listed in the "scheduled
tasks" of windows.
The scheduled task is \\myserver\myshare\myscript.vbs
At the second step, when the scheduled script will be executed, I get
an error (see below). The strange thing is, I only get this error on
some computers. On other computers in the network it works perfect.
There is no difference between W2K and XP.
Another strange thing: when I execute the script manually on the
computers where it fails, the script works fine! Also, when the task is
scheduled, and I change the "run as"-field in the properties to a
domain account, it works fine.
The problem is something with the "system"-account I think. (But it is
strange it works on some computers fine, and on others not).
Anyone a suggestion?
Thx in advance
Mathias
The error is raised at the following line:
Set objexplorer = wscript.CreateObject("InternetExplorer.Application",
"objexplorer_")
The error is "ActiveX component can't create object". With an error
resume next, the next (logical) error is "object required".