At this point, I doubt the variable is defined at all, which may be where Les was headed with Sync/Asych issue...

One last test just to see:

Code:
 

? "Test 5: "
$output=wshpipe('%comspec% /c set',1)
for each $line in $output
if left($line,10 )="clientname"
$found=1
endif
next
if $found=1
"Var Exists"
else
"Var does not exist"
endif

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