Originally Posted By: Mart
You have just one parameter in your function and when you call it you sue two parameters. That’s why you get that error message. Instead of %computername% you can also use @WKSTA. @WKSTA is a macro build into kix and gets filled with the name of the current computer.

Sorry, but how am I using two parameters? The line is messagebox(ReadNC(%computername%),""). %computername% should be the only paramenter for ReadNC. The "" is the second parameter for messagebox.

 Originally Posted By: Mart
When you do a VarTypeName of $EmailServer I guess you will get some kind of array. What happens if you use $EmailServer[0]?

Same error. Regardless of what the variable type is, the error is occuring on line 2.