Any script I try to run from scriptomatic, fails at the

"For Each objItem In colItems"

I'm running the scrips, (and scriptomatic as well) from WinXP. I've
also tried on the scripts several other PC's with the same result. Is
there something I need to add to the scripts to make them function?

What I get back when running the scrips is something like..( I do have
to rem out the first line, on error resume next, in order to get a dos
shell with the following)


==========================================
Computer: Script-tester
==========================================
C:\Scripts\Scriptomatic2\temp_script.sm(17, 4) (null): 0x80041003


C:\Scripts\Scriptomatic2>

Re: Scriptomatic by Andrew

Andrew
Wed Apr 06 11:05:30 CDT 2005

Can you post a sample of the script in question?

--
Andrew C. Madsen
Network Specialist
Harley-Davidson Motor Company
"leadfingers" <ddean2@qwest.net> wrote in message
news:1112762033.208733.287000@l41g2000cwc.googlegroups.com...
> Any script I try to run from scriptomatic, fails at the
>
> "For Each objItem In colItems"
>
> I'm running the scrips, (and scriptomatic as well) from WinXP. I've
> also tried on the scripts several other PC's with the same result. Is
> there something I need to add to the scripts to make them function?
>
> What I get back when running the scrips is something like..( I do have
> to rem out the first line, on error resume next, in order to get a dos
> shell with the following)
>
>
> ==========================================
> Computer: Script-tester
> ==========================================
> C:\Scripts\Scriptomatic2\temp_script.sm(17, 4) (null): 0x80041003
>
>
> C:\Scripts\Scriptomatic2>
>



Re: Scriptomatic by leadfingers

leadfingers
Wed Apr 06 14:01:18 CDT 2005

This sample is taken from the WMI Class Win32_Registry.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array("CTS-WB217Q31")
For Each strComputer In arrComputers
WScript.Echo
WScript.Echo "=========================================="
WScript.Echo "Computer: " & strComputer
WScript.Echo "=========================================="

Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM
Win32_Registry", "WQL", _
wbemFlagReturnImmediately +
wbemFlagForwardOnly)

For Each objItem In colItems
WScript.Echo "Caption: " & objItem.Caption
WScript.Echo "CurrentSize: " & objItem.CurrentSize
WScript.Echo "Description: " & objItem.Description
WScript.Echo "InstallDate: " &
WMIDateStringToDate(objItem.InstallDate)
WScript.Echo "MaximumSize: " & objItem.MaximumSize
WScript.Echo "Name: " & objItem.Name
WScript.Echo "ProposedSize: " & objItem.ProposedSize
WScript.Echo "Status: " & objItem.Status
WScript.Echo
Next
Next


Function WMIDateStringToDate(dtmDate)
WScript.Echo dtm:
WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _
Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _
& " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) & ":" &
Mid(dtmDate,13, 2))
End Function

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

I have tried several of the other scripts from Scriptomatic2, all with
the same result. Since I'm using Windows XP, I felt that versions would
not be the problem, but then I get the impression from what I've read,
is that all the scripts in Scriptomatic should work. Since this is all
new to me, I'm way out in the dark?

Thanks for your response.

Dean






Andrew Madsen wrote:
> Can you post a sample of the script in question?
>
> --
> Andrew C. Madsen
> Network Specialist
> Harley-Davidson Motor Company
> "leadfingers" <ddean2@qwest.net> wrote in message
> news:1112762033.208733.287000@l41g2000cwc.googlegroups.com...
> > Any script I try to run from scriptomatic, fails at the
> >
> > "For Each objItem In colItems"
> >
> > I'm running the scrips, (and scriptomatic as well) from WinXP. I've
> > also tried on the scripts several other PC's with the same result.
Is
> > there something I need to add to the scripts to make them function?
> >
> > What I get back when running the scrips is something like..( I do
have
> > to rem out the first line, on error resume next, in order to get a
dos
> > shell with the following)
> >
> >
> > ==========================================
> > Computer: Script-tester
> > ==========================================
> > C:\Scripts\Scriptomatic2\temp_script.sm(17, 4) (null): 0x80041003
> >
> >
> > C:\Scripts\Scriptomatic2>
> >


Re: Scriptomatic by Andrew

Andrew
Wed Apr 06 15:45:56 CDT 2005

"leadfingers" <ddean2@qwest.net> wrote in message
news:1112814078.700816.89830@o13g2000cwo.googlegroups.com...
> This sample is taken from the WMI Class Win32_Registry.
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Const wbemFlagReturnImmediately = &h10
> Const wbemFlagForwardOnly = &h20
>
> arrComputers = Array("CTS-WB217Q31")
> For Each strComputer In arrComputers
> WScript.Echo
> WScript.Echo "=========================================="
> WScript.Echo "Computer: " & strComputer
> WScript.Echo "=========================================="
>
> Set objWMIService = GetObject("winmgmts:\\" & strComputer &
> "\root\CIMV2")
> Set colItems = objWMIService.ExecQuery("SELECT * FROM
> Win32_Registry", "WQL", _
> wbemFlagReturnImmediately +
> wbemFlagForwardOnly)
>
> For Each objItem In colItems
> WScript.Echo "Caption: " & objItem.Caption
> WScript.Echo "CurrentSize: " & objItem.CurrentSize
> WScript.Echo "Description: " & objItem.Description
> WScript.Echo "InstallDate: " &
> WMIDateStringToDate(objItem.InstallDate)
> WScript.Echo "MaximumSize: " & objItem.MaximumSize
> WScript.Echo "Name: " & objItem.Name
> WScript.Echo "ProposedSize: " & objItem.ProposedSize
> WScript.Echo "Status: " & objItem.Status
> WScript.Echo
> Next
> Next
>
>
> Function WMIDateStringToDate(dtmDate)
> WScript.Echo dtm:
> WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _
> Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _
> & " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) & ":" &
> Mid(dtmDate,13, 2))
> End Function
>
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> I have tried several of the other scripts from Scriptomatic2, all with
> the same result. Since I'm using Windows XP, I felt that versions would
> not be the problem, but then I get the impression from what I've read,
> is that all the scripts in Scriptomatic should work. Since this is all
> new to me, I'm way out in the dark?
>
> Thanks for your response.
>
> Dean
>
>
>
>
>
>
> Andrew Madsen wrote:
> > Can you post a sample of the script in question?
> >
> > --
> > Andrew C. Madsen
> > Network Specialist
> > Harley-Davidson Motor Company
> > "leadfingers" <ddean2@qwest.net> wrote in message
> > news:1112762033.208733.287000@l41g2000cwc.googlegroups.com...
> > > Any script I try to run from scriptomatic, fails at the
> > >
> > > "For Each objItem In colItems"
> > >
> > > I'm running the scrips, (and scriptomatic as well) from WinXP. I've
> > > also tried on the scripts several other PC's with the same result.
> Is
> > > there something I need to add to the scripts to make them function?
> > >
> > > What I get back when running the scrips is something like..( I do
> have
> > > to rem out the first line, on error resume next, in order to get a
> dos
> > > shell with the following)
> > >
> > >
> > > ==========================================
> > > Computer: Script-tester
> > > ==========================================
> > > C:\Scripts\Scriptomatic2\temp_script.sm(17, 4) (null): 0x80041003
> > >
> > >
> > > C:\Scripts\Scriptomatic2>
> > >
>
Do you have SP2 installed? Do all of the scripts fail at the same point?

--
Andrew C. Madsen
Network Specialist
Harley-Davidson Motor Company



Re: Scriptomatic by leadfingers

leadfingers
Wed Apr 06 15:54:29 CDT 2005

yes, they all fail at the same point which is " For Each objItem In
colItems
". We are not running SP 2. We have some issues we need to resolve
first before we can deploy SP2.


Re: Scriptomatic by leadfingers

leadfingers
Wed Apr 06 15:55:41 CDT 2005

yes, they all fail at the same point which is " For Each objItem In
colItems
". We are not running SP 2. We have some issues we need to resolve
first before we can deploy SP2.


Re: Scriptomatic by leadfingers

leadfingers
Wed Apr 06 16:22:34 CDT 2005

yes, they all fail at the same point which is " For Each objItem In
colItems
". We are not running SP 2. We have some issues we need to resolve
first before we can deploy SP2.


Re: Scriptomatic by Andrew

Andrew
Thu Apr 07 09:30:27 CDT 2005

Insert this ahead of the line that reads "For Each objItem in colItems"

if IsArray(colItems) = "False" Then
wscript.echo err.number & " " & err.Description
wscript.echo "objItems is not an array it equals " & objItems"
Else
<the rest of the code>

End If

This will test if colItems has data but is not an array. Also it will
display any error message that may have occurred from the query.
--
Andrew C. Madsen
Network Specialist
Harley-Davidson Motor Company
"leadfingers" <ddean2@qwest.net> wrote in message
news:1112820869.867166.265050@f14g2000cwb.googlegroups.com...
> yes, they all fail at the same point which is " For Each objItem In
> colItems
> ". We are not running SP 2. We have some issues we need to resolve
> first before we can deploy SP2.
>



Re: Scriptomatic by leadfingers

leadfingers
Thu Apr 07 09:31:41 CDT 2005

I tried the Scriptomatic scripts on my home PC which is XP Pro and SP2,
and they mostly worked!!! I would have thought the scripts would be
independent of any Service Packs??

Does anybody out there know why they would work with SP2 and not SP1?
Is there anything outside of SP2 that I can load to make the scripts
run? I don't know how long before we'll be able to go the SP2 route but
I would like to be able to use scripts in the mean time.


Re: Scriptomatic by Andrew

Andrew
Thu Apr 07 13:14:19 CDT 2005

What version of WMI and of Wscript are you running? These work fine on my
2000 Pro desktop against 2000 and 2003 servers.

--
Andrew C. Madsen
Network Specialist
Harley-Davidson Motor Company
"leadfingers" <ddean2@qwest.net> wrote in message
news:1112884301.860018.173110@f14g2000cwb.googlegroups.com...
> I tried the Scriptomatic scripts on my home PC which is XP Pro and SP2,
> and they mostly worked!!! I would have thought the scripts would be
> independent of any Service Packs??
>
> Does anybody out there know why they would work with SP2 and not SP1?
> Is there anything outside of SP2 that I can load to make the scripts
> run? I don't know how long before we'll be able to go the SP2 route but
> I would like to be able to use scripts in the mean time.
>



Re: Scriptomatic by leadfingers

leadfingers
Thu Apr 07 14:05:54 CDT 2005

My Wscript.exe is 5.6.0 and wmic.exe is 5.1.26.

I tried running the scripts against a Win 2000 wrkstn and they run
fine. If I run against my local PC a Win XP Pro SP1 or a remote Win XP
SP1, I have a problem. If I run against my local PC a Win XP Pro SP2
then they run. It looks like the problem is related to the XP service
packs.

I downloaded Microsoft Windows Scripts 5.6 last night, but did not get
anything differant than before. I suspect it was already v5.6. I'll
keep searching MS, and get all the patches and fixes short of SP2 in
hopes of finding something.


aside from this, I've noticed you're with HD. I use the tag Leadfingers
as opposed to Leadfoot, since I love to ride. I'd would love to jump on
a VROC and go. One day maybe.

Thanks for all your insight