Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - The system cannot find the file specified - Win32_NetworkAdapterCo

Reply
 
Old 05-10-2009   #1 (permalink)
RIMikeG


 
 

The system cannot find the file specified - Win32_NetworkAdapterCo

Hi,
I've been using a Microsoft piece of script to obtain the first IP address
of a computer for use in the logon script. This was working fine until some
Microsoft Critical Updates applied on Friday.

Now its returning a message :

The system cannot find the file specified

on line :
For Each IPConfig in IPConfigSet

When it tries to enumerate the Ip addressess.

Has anyone had a similar problem ?

Script is below:



option explicit

Dim m_WshNetwork
Dim m_objWMIService
Dim strComputer

strComputer = "."
Set m_objWMIService =
GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer &
"\root\cimv2")

wscript.echo getFirstIPAddress()


Function getFirstIPAddress

'http://www.microsoft.com/technet/scriptcenter/scripts/network/client/list/nwlsvb01.mspx
Dim IPConfigSet
Dim IPConfig

Set IPConfigSet = m_objWMIService.ExecQuery("Select * from
Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")

For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For intCtr = LBound(IPConfig.IPAddress) to
UBound(IPConfig.IPAddress)
wscript.echo IPConfig.IPAddress(intCtr)
Next
End If
Next

For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For intCtr = LBound(IPConfig.IPAddress) to
UBound(IPConfig.IPAddress)
if (IPConfig.IPAddress(intCtr) <> "0.0.0.0") then
getFirstIPAddress = IPConfig.IPAddress(intCtr)

exit function
End If
Next
End If
Next

End Function

My System SpecsSystem Spec
Old 05-10-2009   #2 (permalink)
Alex K. Angelopoulos


 
 

Re: The system cannot find the file specified - Win32_NetworkAdapterCo

This isn't exactly how you're running it, I don't believe. I say that
because the code you pasted doesn't dim intCtr, which means the script would
fail in real use if it were a monolithic script file.

With that taken care of, it works fine for me. I suspect that the error
you're getting is actually pointing at a real problem somewhere in the code
as you really run it. Are you loading an external file that contains the
script functions, or something?


"RIMikeG" <RIMikeG@xxxxxx> wrote in message
news:FCEAE384-6419-4334-A732-32DF90E965C8@xxxxxx
Quote:

> Hi,
> I've been using a Microsoft piece of script to obtain the first IP
> address
> of a computer for use in the logon script. This was working fine until
> some
> Microsoft Critical Updates applied on Friday.
>
> Now its returning a message :
>
> The system cannot find the file specified
>
> on line :
> For Each IPConfig in IPConfigSet
>
> When it tries to enumerate the Ip addressess.
>
> Has anyone had a similar problem ?
>
> Script is below:
>
>
>
> option explicit
>
> Dim m_WshNetwork
> Dim m_objWMIService
> Dim strComputer
>
> strComputer = "."
> Set m_objWMIService =
> GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer &
> "\root\cimv2")
>
> wscript.echo getFirstIPAddress()
>
>
> Function getFirstIPAddress
>
> 'http://www.microsoft.com/technet/scriptcenter/scripts/network/client/list/nwlsvb01.mspx
> Dim IPConfigSet
> Dim IPConfig
>
> Set IPConfigSet = m_objWMIService.ExecQuery("Select * from
> Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
>
> For Each IPConfig in IPConfigSet
> If Not IsNull(IPConfig.IPAddress) Then
> For intCtr = LBound(IPConfig.IPAddress) to
> UBound(IPConfig.IPAddress)
> wscript.echo IPConfig.IPAddress(intCtr)
> Next
> End If
> Next
>
> For Each IPConfig in IPConfigSet
> If Not IsNull(IPConfig.IPAddress) Then
> For intCtr = LBound(IPConfig.IPAddress) to
> UBound(IPConfig.IPAddress)
> if (IPConfig.IPAddress(intCtr) <> "0.0.0.0") then
> getFirstIPAddress = IPConfig.IPAddress(intCtr)
>
> exit function
> End If
> Next
> End If
> Next
>
> End Function
My System SpecsSystem Spec
Old 05-10-2009   #3 (permalink)
RIMikeG


 
 

Re: The system cannot find the file specified - Win32_NetworkAdapt

Alex,
The script is running stand-alone - although you are correct that it was
extracted from the larger script which is also failing.

I'm not sure why the 'Option Explicit' wasn't catching the fact that intCtr
was not defined - but it wasn't getting to that code anyway.

There is no loading of external script files.

I've confirmed this error is generated the moment variable IPConfigSet is
accessed.

All this was working fine.......





"Alex K. Angelopoulos" wrote:
Quote:

> This isn't exactly how you're running it, I don't believe. I say that
> because the code you pasted doesn't dim intCtr, which means the script would
> fail in real use if it were a monolithic script file.
>
> With that taken care of, it works fine for me. I suspect that the error
> you're getting is actually pointing at a real problem somewhere in the code
> as you really run it. Are you loading an external file that contains the
> script functions, or something?
>
>
> "RIMikeG" <RIMikeG@xxxxxx> wrote in message
> news:FCEAE384-6419-4334-A732-32DF90E965C8@xxxxxx
Quote:

> > Hi,
> > I've been using a Microsoft piece of script to obtain the first IP
> > address
> > of a computer for use in the logon script. This was working fine until
> > some
> > Microsoft Critical Updates applied on Friday.
> >
> > Now its returning a message :
> >
> > The system cannot find the file specified
> >
> > on line :
> > For Each IPConfig in IPConfigSet
> >
> > When it tries to enumerate the Ip addressess.
> >
> > Has anyone had a similar problem ?
> >
> > Script is below:
> >
> >
> >
> > option explicit
> >
> > Dim m_WshNetwork
> > Dim m_objWMIService
> > Dim strComputer
> >
> > strComputer = "."
> > Set m_objWMIService =
> > GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer &
> > "\root\cimv2")
> >
> > wscript.echo getFirstIPAddress()
> >
> >
> > Function getFirstIPAddress
> >
> > 'http://www.microsoft.com/technet/scriptcenter/scripts/network/client/list/nwlsvb01.mspx
> > Dim IPConfigSet
> > Dim IPConfig
> >
> > Set IPConfigSet = m_objWMIService.ExecQuery("Select * from
> > Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
> >
> > For Each IPConfig in IPConfigSet
> > If Not IsNull(IPConfig.IPAddress) Then
> > For intCtr = LBound(IPConfig.IPAddress) to
> > UBound(IPConfig.IPAddress)
> > wscript.echo IPConfig.IPAddress(intCtr)
> > Next
> > End If
> > Next
> >
> > For Each IPConfig in IPConfigSet
> > If Not IsNull(IPConfig.IPAddress) Then
> > For intCtr = LBound(IPConfig.IPAddress) to
> > UBound(IPConfig.IPAddress)
> > if (IPConfig.IPAddress(intCtr) <> "0.0.0.0") then
> > getFirstIPAddress = IPConfig.IPAddress(intCtr)
> >
> > exit function
> > End If
> > Next
> > End If
> > Next
> >
> > End Function
>
>
My System SpecsSystem Spec
Old 05-10-2009   #4 (permalink)
Richard Mueller [MVP]


 
 

Re: The system cannot find the file specified - Win32_NetworkAdapt

The script works fine for me, once I added "Dim intCtr". Is the OS Vista?
The only update I've seen recently (5/7) is IE 8 for Vista.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--

"RIMikeG" <RIMikeG@xxxxxx> wrote in message
news:E4DD917E-272F-43F4-BD38-F3E0532F52B6@xxxxxx
Quote:

> Alex,
> The script is running stand-alone - although you are correct that it was
> extracted from the larger script which is also failing.
>
> I'm not sure why the 'Option Explicit' wasn't catching the fact that
> intCtr
> was not defined - but it wasn't getting to that code anyway.
>
> There is no loading of external script files.
>
> I've confirmed this error is generated the moment variable IPConfigSet is
> accessed.
>
> All this was working fine.......
>
>
>
>
>
> "Alex K. Angelopoulos" wrote:
>
Quote:

>> This isn't exactly how you're running it, I don't believe. I say that
>> because the code you pasted doesn't dim intCtr, which means the script
>> would
>> fail in real use if it were a monolithic script file.
>>
>> With that taken care of, it works fine for me. I suspect that the error
>> you're getting is actually pointing at a real problem somewhere in the
>> code
>> as you really run it. Are you loading an external file that contains the
>> script functions, or something?
>>
>>
>> "RIMikeG" <RIMikeG@xxxxxx> wrote in message
>> news:FCEAE384-6419-4334-A732-32DF90E965C8@xxxxxx
Quote:

>> > Hi,
>> > I've been using a Microsoft piece of script to obtain the first IP
>> > address
>> > of a computer for use in the logon script. This was working fine until
>> > some
>> > Microsoft Critical Updates applied on Friday.
>> >
>> > Now its returning a message :
>> >
>> > The system cannot find the file specified
>> >
>> > on line :
>> > For Each IPConfig in IPConfigSet
>> >
>> > When it tries to enumerate the Ip addressess.
>> >
>> > Has anyone had a similar problem ?
>> >
>> > Script is below:
>> >
>> >
>> >
>> > option explicit
>> >
>> > Dim m_WshNetwork
>> > Dim m_objWMIService
>> > Dim strComputer
>> >
>> > strComputer = "."
>> > Set m_objWMIService =
>> > GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer
>> > &
>> > "\root\cimv2")
>> >
>> > wscript.echo getFirstIPAddress()
>> >
>> >
>> > Function getFirstIPAddress
>> >
>> > 'http://www.microsoft.com/technet/scriptcenter/scripts/network/client/list/nwlsvb01.mspx
>> > Dim IPConfigSet
>> > Dim IPConfig
>> >
>> > Set IPConfigSet = m_objWMIService.ExecQuery("Select * from
>> > Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
>> >
>> > For Each IPConfig in IPConfigSet
>> > If Not IsNull(IPConfig.IPAddress) Then
>> > For intCtr = LBound(IPConfig.IPAddress) to
>> > UBound(IPConfig.IPAddress)
>> > wscript.echo IPConfig.IPAddress(intCtr)
>> > Next
>> > End If
>> > Next
>> >
>> > For Each IPConfig in IPConfigSet
>> > If Not IsNull(IPConfig.IPAddress) Then
>> > For intCtr = LBound(IPConfig.IPAddress) to
>> > UBound(IPConfig.IPAddress)
>> > if (IPConfig.IPAddress(intCtr) <> "0.0.0.0") then
>> > getFirstIPAddress = IPConfig.IPAddress(intCtr)
>> >
>> > exit function
>> > End If
>> > Next
>> > End If
>> > Next
>> >
>> > End Function
>>
>>

My System SpecsSystem Spec
Old 05-10-2009   #5 (permalink)
RIMikeG


 
 

Re: The system cannot find the file specified - Win32_NetworkAdapt

Hi,
I think I've found the problem - Kaperksy A/V had REMOVED the wmiprvse.exe
as a trojan per below. I restored the file and problem solved !!!!!
Looking into whether this was a 'false positive'.........

deleted: Trojan program Backdoor.Win32.Agent.afqs File:
C:\WINDOWS\system32\wbem\wmiprvse.exe

Regards
Michael Green



"Richard Mueller [MVP]" wrote:
Quote:

> The script works fine for me, once I added "Dim intCtr". Is the OS Vista?
> The only update I've seen recently (5/7) is IE 8 for Vista.
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab - http://www.rlmueller.net
> --
>
> "RIMikeG" <RIMikeG@xxxxxx> wrote in message
> news:E4DD917E-272F-43F4-BD38-F3E0532F52B6@xxxxxx
Quote:

> > Alex,
> > The script is running stand-alone - although you are correct that it was
> > extracted from the larger script which is also failing.
> >
> > I'm not sure why the 'Option Explicit' wasn't catching the fact that
> > intCtr
> > was not defined - but it wasn't getting to that code anyway.
> >
> > There is no loading of external script files.
> >
> > I've confirmed this error is generated the moment variable IPConfigSet is
> > accessed.
> >
> > All this was working fine.......
> >
> >
> >
> >
> >
> > "Alex K. Angelopoulos" wrote:
> >
Quote:

> >> This isn't exactly how you're running it, I don't believe. I say that
> >> because the code you pasted doesn't dim intCtr, which means the script
> >> would
> >> fail in real use if it were a monolithic script file.
> >>
> >> With that taken care of, it works fine for me. I suspect that the error
> >> you're getting is actually pointing at a real problem somewhere in the
> >> code
> >> as you really run it. Are you loading an external file that contains the
> >> script functions, or something?
> >>
> >>
> >> "RIMikeG" <RIMikeG@xxxxxx> wrote in message
> >> news:FCEAE384-6419-4334-A732-32DF90E965C8@xxxxxx
> >> > Hi,
> >> > I've been using a Microsoft piece of script to obtain the first IP
> >> > address
> >> > of a computer for use in the logon script. This was working fine until
> >> > some
> >> > Microsoft Critical Updates applied on Friday.
> >> >
> >> > Now its returning a message :
> >> >
> >> > The system cannot find the file specified
> >> >
> >> > on line :
> >> > For Each IPConfig in IPConfigSet
> >> >
> >> > When it tries to enumerate the Ip addressess.
> >> >
> >> > Has anyone had a similar problem ?
> >> >
> >> > Script is below:
> >> >
> >> >
> >> >
> >> > option explicit
> >> >
> >> > Dim m_WshNetwork
> >> > Dim m_objWMIService
> >> > Dim strComputer
> >> >
> >> > strComputer = "."
> >> > Set m_objWMIService =
> >> > GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer
> >> > &
> >> > "\root\cimv2")
> >> >
> >> > wscript.echo getFirstIPAddress()
> >> >
> >> >
> >> > Function getFirstIPAddress
> >> >
> >> > 'http://www.microsoft.com/technet/scriptcenter/scripts/network/client/list/nwlsvb01.mspx
> >> > Dim IPConfigSet
> >> > Dim IPConfig
> >> >
> >> > Set IPConfigSet = m_objWMIService.ExecQuery("Select * from
> >> > Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
> >> >
> >> > For Each IPConfig in IPConfigSet
> >> > If Not IsNull(IPConfig.IPAddress) Then
> >> > For intCtr = LBound(IPConfig.IPAddress) to
> >> > UBound(IPConfig.IPAddress)
> >> > wscript.echo IPConfig.IPAddress(intCtr)
> >> > Next
> >> > End If
> >> > Next
> >> >
> >> > For Each IPConfig in IPConfigSet
> >> > If Not IsNull(IPConfig.IPAddress) Then
> >> > For intCtr = LBound(IPConfig.IPAddress) to
> >> > UBound(IPConfig.IPAddress)
> >> > if (IPConfig.IPAddress(intCtr) <> "0.0.0.0") then
> >> > getFirstIPAddress = IPConfig.IPAddress(intCtr)
> >> >
> >> > exit function
> >> > End If
> >> > Next
> >> > End If
> >> > Next
> >> >
> >> > End Function
> >>
> >>
>
>
>
My System SpecsSystem Spec
Old 05-10-2009   #6 (permalink)
RIMikeG


 
 

Re: The system cannot find the file specified - Win32_NetworkAdapt

And that should have been "Kaspersky"...

"RIMikeG" wrote:
Quote:

> Hi,
> I think I've found the problem - Kaperksy A/V had REMOVED the wmiprvse.exe
> as a trojan per below. I restored the file and problem solved !!!!!
> Looking into whether this was a 'false positive'.........
>
> deleted: Trojan program Backdoor.Win32.Agent.afqs File:
> C:\WINDOWS\system32\wbem\wmiprvse.exe
>
> Regards
> Michael Green
>
>
>
> "Richard Mueller [MVP]" wrote:
>
Quote:

> > The script works fine for me, once I added "Dim intCtr". Is the OS Vista?
> > The only update I've seen recently (5/7) is IE 8 for Vista.
> >
> > --
> > Richard Mueller
> > MVP Directory Services
> > Hilltop Lab - http://www.rlmueller.net
> > --
> >
> > "RIMikeG" <RIMikeG@xxxxxx> wrote in message
> > news:E4DD917E-272F-43F4-BD38-F3E0532F52B6@xxxxxx
Quote:

> > > Alex,
> > > The script is running stand-alone - although you are correct that it was
> > > extracted from the larger script which is also failing.
> > >
> > > I'm not sure why the 'Option Explicit' wasn't catching the fact that
> > > intCtr
> > > was not defined - but it wasn't getting to that code anyway.
> > >
> > > There is no loading of external script files.
> > >
> > > I've confirmed this error is generated the moment variable IPConfigSet is
> > > accessed.
> > >
> > > All this was working fine.......
> > >
> > >
> > >
> > >
> > >
> > > "Alex K. Angelopoulos" wrote:
> > >
> > >> This isn't exactly how you're running it, I don't believe. I say that
> > >> because the code you pasted doesn't dim intCtr, which means the script
> > >> would
> > >> fail in real use if it were a monolithic script file.
> > >>
> > >> With that taken care of, it works fine for me. I suspect that the error
> > >> you're getting is actually pointing at a real problem somewhere in the
> > >> code
> > >> as you really run it. Are you loading an external file that contains the
> > >> script functions, or something?
> > >>
> > >>
> > >> "RIMikeG" <RIMikeG@xxxxxx> wrote in message
> > >> news:FCEAE384-6419-4334-A732-32DF90E965C8@xxxxxx
> > >> > Hi,
> > >> > I've been using a Microsoft piece of script to obtain the first IP
> > >> > address
> > >> > of a computer for use in the logon script. This was working fine until
> > >> > some
> > >> > Microsoft Critical Updates applied on Friday.
> > >> >
> > >> > Now its returning a message :
> > >> >
> > >> > The system cannot find the file specified
> > >> >
> > >> > on line :
> > >> > For Each IPConfig in IPConfigSet
> > >> >
> > >> > When it tries to enumerate the Ip addressess.
> > >> >
> > >> > Has anyone had a similar problem ?
> > >> >
> > >> > Script is below:
> > >> >
> > >> >
> > >> >
> > >> > option explicit
> > >> >
> > >> > Dim m_WshNetwork
> > >> > Dim m_objWMIService
> > >> > Dim strComputer
> > >> >
> > >> > strComputer = "."
> > >> > Set m_objWMIService =
> > >> > GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer
> > >> > &
> > >> > "\root\cimv2")
> > >> >
> > >> > wscript.echo getFirstIPAddress()
> > >> >
> > >> >
> > >> > Function getFirstIPAddress
> > >> >
> > >> > 'http://www.microsoft.com/technet/scriptcenter/scripts/network/client/list/nwlsvb01.mspx
> > >> > Dim IPConfigSet
> > >> > Dim IPConfig
> > >> >
> > >> > Set IPConfigSet = m_objWMIService.ExecQuery("Select * from
> > >> > Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
> > >> >
> > >> > For Each IPConfig in IPConfigSet
> > >> > If Not IsNull(IPConfig.IPAddress) Then
> > >> > For intCtr = LBound(IPConfig.IPAddress) to
> > >> > UBound(IPConfig.IPAddress)
> > >> > wscript.echo IPConfig.IPAddress(intCtr)
> > >> > Next
> > >> > End If
> > >> > Next
> > >> >
> > >> > For Each IPConfig in IPConfigSet
> > >> > If Not IsNull(IPConfig.IPAddress) Then
> > >> > For intCtr = LBound(IPConfig.IPAddress) to
> > >> > UBound(IPConfig.IPAddress)
> > >> > if (IPConfig.IPAddress(intCtr) <> "0.0.0.0") then
> > >> > getFirstIPAddress = IPConfig.IPAddress(intCtr)
> > >> >
> > >> > exit function
> > >> > End If
> > >> > Next
> > >> > End If
> > >> > Next
> > >> >
> > >> > End Function
> > >>
> > >>
> >
> >
> >
My System SpecsSystem Spec
Old 05-11-2009   #7 (permalink)
Alex K. Angelopoulos


 
 

Re: The system cannot find the file specified - Win32_NetworkAdapt

LOL!

And the error bubbled up at that point was actually correct - in spite of
being at least two layers away from VBScript. That's a bit surprising.


"RIMikeG" <RIMikeG@xxxxxx> wrote in message
news:3D03E67D-C411-429D-9E01-2CF26ACA7480@xxxxxx
Quote:

> And that should have been "Kaspersky"...
>
> "RIMikeG" wrote:
>
Quote:

>> Hi,
>> I think I've found the problem - Kaperksy A/V had REMOVED the
>> wmiprvse.exe
>> as a trojan per below. I restored the file and problem solved !!!!!
>> Looking into whether this was a 'false positive'.........
>>
>> deleted: Trojan program Backdoor.Win32.Agent.afqs File:
>> C:\WINDOWS\system32\wbem\wmiprvse.exe
>>
>> Regards
>> Michael Green
>>
>>
>>
>> "Richard Mueller [MVP]" wrote:
>>
Quote:

>> > The script works fine for me, once I added "Dim intCtr". Is the OS
>> > Vista?
>> > The only update I've seen recently (5/7) is IE 8 for Vista.
>> >
>> > --
>> > Richard Mueller
>> > MVP Directory Services
>> > Hilltop Lab - http://www.rlmueller.net
>> > --
>> >
>> > "RIMikeG" <RIMikeG@xxxxxx> wrote in message
>> > news:E4DD917E-272F-43F4-BD38-F3E0532F52B6@xxxxxx
>> > > Alex,
>> > > The script is running stand-alone - although you are correct that it
>> > > was
>> > > extracted from the larger script which is also failing.
>> > >
>> > > I'm not sure why the 'Option Explicit' wasn't catching the fact that
>> > > intCtr
>> > > was not defined - but it wasn't getting to that code anyway.
>> > >
>> > > There is no loading of external script files.
>> > >
>> > > I've confirmed this error is generated the moment variable
>> > > IPConfigSet is
>> > > accessed.
>> > >
>> > > All this was working fine.......
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > "Alex K. Angelopoulos" wrote:
>> > >
>> > >> This isn't exactly how you're running it, I don't believe. I say
>> > >> that
>> > >> because the code you pasted doesn't dim intCtr, which means the
>> > >> script
>> > >> would
>> > >> fail in real use if it were a monolithic script file.
>> > >>
>> > >> With that taken care of, it works fine for me. I suspect that the
>> > >> error
>> > >> you're getting is actually pointing at a real problem somewhere in
>> > >> the
>> > >> code
>> > >> as you really run it. Are you loading an external file that contains
>> > >> the
>> > >> script functions, or something?
>> > >>
>> > >>
>> > >> "RIMikeG" <RIMikeG@xxxxxx> wrote in message
>> > >> news:FCEAE384-6419-4334-A732-32DF90E965C8@xxxxxx
>> > >> > Hi,
>> > >> > I've been using a Microsoft piece of script to obtain the first
>> > >> > IP
>> > >> > address
>> > >> > of a computer for use in the logon script. This was working fine
>> > >> > until
>> > >> > some
>> > >> > Microsoft Critical Updates applied on Friday.
>> > >> >
>> > >> > Now its returning a message :
>> > >> >
>> > >> > The system cannot find the file specified
>> > >> >
>> > >> > on line :
>> > >> > For Each IPConfig in IPConfigSet
>> > >> >
>> > >> > When it tries to enumerate the Ip addressess.
>> > >> >
>> > >> > Has anyone had a similar problem ?
>> > >> >
>> > >> > Script is below:
>> > >> >
>> > >> >
>> > >> >
>> > >> > option explicit
>> > >> >
>> > >> > Dim m_WshNetwork
>> > >> > Dim m_objWMIService
>> > >> > Dim strComputer
>> > >> >
>> > >> > strComputer = "."
>> > >> > Set m_objWMIService =
>> > >> > GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
>> > >> > strComputer
>> > >> > &
>> > >> > "\root\cimv2")
>> > >> >
>> > >> > wscript.echo getFirstIPAddress()
>> > >> >
>> > >> >
>> > >> > Function getFirstIPAddress
>> > >> >
>> > >> > 'http://www.microsoft.com/technet/scriptcenter/scripts/network/client/list/nwlsvb01.mspx
>> > >> > Dim IPConfigSet
>> > >> > Dim IPConfig
>> > >> >
>> > >> > Set IPConfigSet = m_objWMIService.ExecQuery("Select * from
>> > >> > Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
>> > >> >
>> > >> > For Each IPConfig in IPConfigSet
>> > >> > If Not IsNull(IPConfig.IPAddress) Then
>> > >> > For intCtr = LBound(IPConfig.IPAddress) to
>> > >> > UBound(IPConfig.IPAddress)
>> > >> > wscript.echo IPConfig.IPAddress(intCtr)
>> > >> > Next
>> > >> > End If
>> > >> > Next
>> > >> >
>> > >> > For Each IPConfig in IPConfigSet
>> > >> > If Not IsNull(IPConfig.IPAddress) Then
>> > >> > For intCtr = LBound(IPConfig.IPAddress) to
>> > >> > UBound(IPConfig.IPAddress)
>> > >> > if (IPConfig.IPAddress(intCtr) <> "0.0.0.0") then
>> > >> > getFirstIPAddress = IPConfig.IPAddress(intCtr)
>> > >> >
>> > >> > exit function
>> > >> > End If
>> > >> > Next
>> > >> > End If
>> > >> > Next
>> > >> >
>> > >> > End Function
>> > >>
>> > >>
>> >
>> >
>> >
My System SpecsSystem Spec
Old 05-11-2009   #8 (permalink)
RIMikeG


 
 

Re: The system cannot find the file specified - Win32_NetworkAdapt

Hi,
I'm pretty sure I've confirmed it was a 'fasle positive' by Kaspersky. I
restored the infected exe using Kaspersky, updated the Kaspersky definitions
and ran a full scan. Nothing !. I'm wondering whether they stuffed up an
update ????
Regards
Michael


"Alex K. Angelopoulos" wrote:
Quote:

> LOL!
>
> And the error bubbled up at that point was actually correct - in spite of
> being at least two layers away from VBScript. That's a bit surprising.
>
>
> "RIMikeG" <RIMikeG@xxxxxx> wrote in message
> news:3D03E67D-C411-429D-9E01-2CF26ACA7480@xxxxxx
Quote:

> > And that should have been "Kaspersky"...
> >
> > "RIMikeG" wrote:
> >
Quote:

> >> Hi,
> >> I think I've found the problem - Kaperksy A/V had REMOVED the
> >> wmiprvse.exe
> >> as a trojan per below. I restored the file and problem solved !!!!!
> >> Looking into whether this was a 'false positive'.........
> >>
> >> deleted: Trojan program Backdoor.Win32.Agent.afqs File:
> >> C:\WINDOWS\system32\wbem\wmiprvse.exe
> >>
> >> Regards
> >> Michael Green
> >>
> >>
> >>
> >> "Richard Mueller [MVP]" wrote:
> >>
> >> > The script works fine for me, once I added "Dim intCtr". Is the OS
> >> > Vista?
> >> > The only update I've seen recently (5/7) is IE 8 for Vista.
> >> >
> >> > --
> >> > Richard Mueller
> >> > MVP Directory Services
> >> > Hilltop Lab - http://www.rlmueller.net
> >> > --
> >> >
> >> > "RIMikeG" <RIMikeG@xxxxxx> wrote in message
> >> > news:E4DD917E-272F-43F4-BD38-F3E0532F52B6@xxxxxx
> >> > > Alex,
> >> > > The script is running stand-alone - although you are correct that it
> >> > > was
> >> > > extracted from the larger script which is also failing.
> >> > >
> >> > > I'm not sure why the 'Option Explicit' wasn't catching the fact that
> >> > > intCtr
> >> > > was not defined - but it wasn't getting to that code anyway.
> >> > >
> >> > > There is no loading of external script files.
> >> > >
> >> > > I've confirmed this error is generated the moment variable
> >> > > IPConfigSet is
> >> > > accessed.
> >> > >
> >> > > All this was working fine.......
> >> > >
> >> > >
> >> > >
> >> > >
> >> > >
> >> > > "Alex K. Angelopoulos" wrote:
> >> > >
> >> > >> This isn't exactly how you're running it, I don't believe. I say
> >> > >> that
> >> > >> because the code you pasted doesn't dim intCtr, which means the
> >> > >> script
> >> > >> would
> >> > >> fail in real use if it were a monolithic script file.
> >> > >>
> >> > >> With that taken care of, it works fine for me. I suspect that the
> >> > >> error
> >> > >> you're getting is actually pointing at a real problem somewhere in
> >> > >> the
> >> > >> code
> >> > >> as you really run it. Are you loading an external file that contains
> >> > >> the
> >> > >> script functions, or something?
> >> > >>
> >> > >>
> >> > >> "RIMikeG" <RIMikeG@xxxxxx> wrote in message
> >> > >> news:FCEAE384-6419-4334-A732-32DF90E965C8@xxxxxx
> >> > >> > Hi,
> >> > >> > I've been using a Microsoft piece of script to obtain the first
> >> > >> > IP
> >> > >> > address
> >> > >> > of a computer for use in the logon script. This was working fine
> >> > >> > until
> >> > >> > some
> >> > >> > Microsoft Critical Updates applied on Friday.
> >> > >> >
> >> > >> > Now its returning a message :
> >> > >> >
> >> > >> > The system cannot find the file specified
> >> > >> >
> >> > >> > on line :
> >> > >> > For Each IPConfig in IPConfigSet
> >> > >> >
> >> > >> > When it tries to enumerate the Ip addressess.
> >> > >> >
> >> > >> > Has anyone had a similar problem ?
> >> > >> >
> >> > >> > Script is below:
> >> > >> >
> >> > >> >
> >> > >> >
> >> > >> > option explicit
> >> > >> >
> >> > >> > Dim m_WshNetwork
> >> > >> > Dim m_objWMIService
> >> > >> > Dim strComputer
> >> > >> >
> >> > >> > strComputer = "."
> >> > >> > Set m_objWMIService =
> >> > >> > GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
> >> > >> > strComputer
> >> > >> > &
> >> > >> > "\root\cimv2")
> >> > >> >
> >> > >> > wscript.echo getFirstIPAddress()
> >> > >> >
> >> > >> >
> >> > >> > Function getFirstIPAddress
> >> > >> >
> >> > >> > 'http://www.microsoft.com/technet/scriptcenter/scripts/network/client/list/nwlsvb01.mspx
> >> > >> > Dim IPConfigSet
> >> > >> > Dim IPConfig
> >> > >> >
> >> > >> > Set IPConfigSet = m_objWMIService.ExecQuery("Select * from
> >> > >> > Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
> >> > >> >
> >> > >> > For Each IPConfig in IPConfigSet
> >> > >> > If Not IsNull(IPConfig.IPAddress) Then
> >> > >> > For intCtr = LBound(IPConfig.IPAddress) to
> >> > >> > UBound(IPConfig.IPAddress)
> >> > >> > wscript.echo IPConfig.IPAddress(intCtr)
> >> > >> > Next
> >> > >> > End If
> >> > >> > Next
> >> > >> >
> >> > >> > For Each IPConfig in IPConfigSet
> >> > >> > If Not IsNull(IPConfig.IPAddress) Then
> >> > >> > For intCtr = LBound(IPConfig.IPAddress) to
> >> > >> > UBound(IPConfig.IPAddress)
> >> > >> > if (IPConfig.IPAddress(intCtr) <> "0.0.0.0") then
> >> > >> > getFirstIPAddress = IPConfig.IPAddress(intCtr)
> >> > >> >
> >> > >> > exit function
> >> > >> > End If
> >> > >> > Next
> >> > >> > End If
> >> > >> > Next
> >> > >> >
> >> > >> > End Function
> >> > >>
> >> > >>
> >> >
> >> >
> >> >
>
My System SpecsSystem Spec
Old 05-11-2009   #9 (permalink)
Alex K. Angelopoulos


 
 

Re: The system cannot find the file specified - Win32_NetworkAdapt

Yes, they did:

http://forum.kaspersky.com/index.php?showtopic=113635

that's a really big oops. My guess was going to be that it was accidentally
triggered by heuristics, but it looks like several people ran afoul of the
same update.

"RIMikeG" <RIMikeG@xxxxxx> wrote in message
news:E0230508-9F10-411D-9571-D607B8674D8B@xxxxxx
Quote:

> Hi,
> I'm pretty sure I've confirmed it was a 'fasle positive' by Kaspersky. I
> restored the infected exe using Kaspersky, updated the Kaspersky
> definitions
> and ran a full scan. Nothing !. I'm wondering whether they stuffed up an
> update ????
> Regards
> Michael
>
>
> "Alex K. Angelopoulos" wrote:
>
Quote:

>> LOL!
>>
>> And the error bubbled up at that point was actually correct - in spite of
>> being at least two layers away from VBScript. That's a bit surprising.
>>
>>
>> "RIMikeG" <RIMikeG@xxxxxx> wrote in message
>> news:3D03E67D-C411-429D-9E01-2CF26ACA7480@xxxxxx
Quote:

>> > And that should have been "Kaspersky"...
>> >
>> > "RIMikeG" wrote:
>> >
>> >> Hi,
>> >> I think I've found the problem - Kaperksy A/V had REMOVED the
>> >> wmiprvse.exe
>> >> as a trojan per below. I restored the file and problem solved !!!!!
>> >> Looking into whether this was a 'false positive'.........
>> >>
>> >> deleted: Trojan program Backdoor.Win32.Agent.afqs File:
>> >> C:\WINDOWS\system32\wbem\wmiprvse.exe
>> >>
>> >> Regards
>> >> Michael Green
>> >>
>> >>
>> >>
>> >> "Richard Mueller [MVP]" wrote:
>> >>
>> >> > The script works fine for me, once I added "Dim intCtr". Is the OS
>> >> > Vista?
>> >> > The only update I've seen recently (5/7) is IE 8 for Vista.
>> >> >
>> >> > --
>> >> > Richard Mueller
>> >> > MVP Directory Services
>> >> > Hilltop Lab - http://www.rlmueller.net
>> >> > --
>> >> >
>> >> > "RIMikeG" <RIMikeG@xxxxxx> wrote in message
>> >> > news:E4DD917E-272F-43F4-BD38-F3E0532F52B6@xxxxxx
>> >> > > Alex,
>> >> > > The script is running stand-alone - although you are correct that
>> >> > > it
>> >> > > was
>> >> > > extracted from the larger script which is also failing.
>> >> > >
>> >> > > I'm not sure why the 'Option Explicit' wasn't catching the fact
>> >> > > that
>> >> > > intCtr
>> >> > > was not defined - but it wasn't getting to that code anyway.
>> >> > >
>> >> > > There is no loading of external script files.
>> >> > >
>> >> > > I've confirmed this error is generated the moment variable
>> >> > > IPConfigSet is
>> >> > > accessed.
>> >> > >
>> >> > > All this was working fine.......
>> >> > >
>> >> > >
>> >> > >
>> >> > >
>> >> > >
>> >> > > "Alex K. Angelopoulos" wrote:
>> >> > >
>> >> > >> This isn't exactly how you're running it, I don't believe. I say
>> >> > >> that
>> >> > >> because the code you pasted doesn't dim intCtr, which means the
>> >> > >> script
>> >> > >> would
>> >> > >> fail in real use if it were a monolithic script file.
>> >> > >>
>> >> > >> With that taken care of, it works fine for me. I suspect that the
>> >> > >> error
>> >> > >> you're getting is actually pointing at a real problem somewhere
>> >> > >> in
>> >> > >> the
>> >> > >> code
>> >> > >> as you really run it. Are you loading an external file that
>> >> > >> contains
>> >> > >> the
>> >> > >> script functions, or something?
>> >> > >>
>> >> > >>
>> >> > >> "RIMikeG" <RIMikeG@xxxxxx> wrote in message
>> >> > >> news:FCEAE384-6419-4334-A732-32DF90E965C8@xxxxxx
>> >> > >> > Hi,
>> >> > >> > I've been using a Microsoft piece of script to obtain the
>> >> > >> > first
>> >> > >> > IP
>> >> > >> > address
>> >> > >> > of a computer for use in the logon script. This was working
>> >> > >> > fine
>> >> > >> > until
>> >> > >> > some
>> >> > >> > Microsoft Critical Updates applied on Friday.
>> >> > >> >
>> >> > >> > Now its returning a message :
>> >> > >> >
>> >> > >> > The system cannot find the file specified
>> >> > >> >
>> >> > >> > on line :
>> >> > >> > For Each IPConfig in IPConfigSet
>> >> > >> >
>> >> > >> > When it tries to enumerate the Ip addressess.
>> >> > >> >
>> >> > >> > Has anyone had a similar problem ?
>> >> > >> >
>> >> > >> > Script is below:
>> >> > >> >
>> >> > >> >
>> >> > >> >
>> >> > >> > option explicit
>> >> > >> >
>> >> > >> > Dim m_WshNetwork
>> >> > >> > Dim m_objWMIService
>> >> > >> > Dim strComputer
>> >> > >> >
>> >> > >> > strComputer = "."
>> >> > >> > Set m_objWMIService =
>> >> > >> > GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
>> >> > >> > strComputer
>> >> > >> > &
>> >> > >> > "\root\cimv2")
>> >> > >> >
>> >> > >> > wscript.echo getFirstIPAddress()
>> >> > >> >
>> >> > >> >
>> >> > >> > Function getFirstIPAddress
>> >> > >> >
>> >> > >> > 'http://www.microsoft.com/technet/scriptcenter/scripts/network/client/list/nwlsvb01.mspx
>> >> > >> > Dim IPConfigSet
>> >> > >> > Dim IPConfig
>> >> > >> >
>> >> > >> > Set IPConfigSet = m_objWMIService.ExecQuery("Select * from
>> >> > >> > Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
>> >> > >> >
>> >> > >> > For Each IPConfig in IPConfigSet
>> >> > >> > If Not IsNull(IPConfig.IPAddress) Then
>> >> > >> > For intCtr = LBound(IPConfig.IPAddress) to
>> >> > >> > UBound(IPConfig.IPAddress)
>> >> > >> > wscript.echo IPConfig.IPAddress(intCtr)
>> >> > >> > Next
>> >> > >> > End If
>> >> > >> > Next
>> >> > >> >
>> >> > >> > For Each IPConfig in IPConfigSet
>> >> > >> > If Not IsNull(IPConfig.IPAddress) Then
>> >> > >> > For intCtr = LBound(IPConfig.IPAddress) to
>> >> > >> > UBound(IPConfig.IPAddress)
>> >> > >> > if (IPConfig.IPAddress(intCtr) <> "0.0.0.0")
>> >> > >> > then
>> >> > >> > getFirstIPAddress =
>> >> > >> > IPConfig.IPAddress(intCtr)
>> >> > >> >
>> >> > >> > exit function
>> >> > >> > End If
>> >> > >> > Next
>> >> > >> > End If
>> >> > >> > Next
>> >> > >> >
>> >> > >> > End Function
>> >> > >>
>> >> > >>
>> >> >
>> >> >
>> >> >
>>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
The system cannot find the file specified. (0x80070002) Vista General
Could not add the requested feature. The error is: The system cannot find the file sp Network & Sharing
The system couldn't find the file specified. Vista hardware & devices
backup error "the system cannot find the file specified 0x80070002 Vista performance & maintenance
The system cannot find the file specified Vista file management


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46