I have a VBScript that will tell me what server a user is logged into, in the form of UserName:ServerName. I want to use that information in a script, so I setup the following:
Code:
$rc=split("WshPipe("cscript //nologo C:\WhereIs.wsf operez",1)",":")
? $rc(0)
? $rc(1)
Function WshPipe($ShellCMD, OPTIONAL $NoEcho)
Dim $oExec, $Output
$oExec = CreateObject("WScript.Shell").Exec($ShellCMD)
If Not VarType($oExec)=9 $WshPipe="WScript.Shell Exec Unsupported" Exit 10 EndIf
$Output = $oExec.StdOut.ReadAll + $oExec.StdErr.ReadAll
If Not $NoEcho $Output Endif
$WshPipe=Split(Join(Split($Output,CHR(13)),''),CHR(10))
Exit($oExec.ExitCode)
EndFunction
I am getting an “Error in expression: this type of array not supported in expressions.! Line: 2” error message. It’s been awhile since I used kix, but what am I doing wrong?