Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

Latest posts

Why am I Getting an Error when Trying to Determine an IP Address?
Aug 25, 2004
0
0

Why am I Getting an Error when Trying to Determine an IP Address?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! I’m trying to determine the IP address on a computer, but I keep getting a Type Mismatch error. Do you know why? -- AQ, Jacksonville, FL Hey, AQ. As a matter of fact, we do know why you’re getting a Type Mismatch error, and it’s a common problem when working with the WMI class Win32_NetworkAdapterConfiguration. The line in your script that’s causing the problem most likely looks something like this: So what’s the problem? Well, the IPAddress property is actually stored as an array; that’s because it’s possible for multiple IP addresses to be assigned to a single network adapter. You’re treati...