I think the problem is getting the output back from comspec into kix. There used to be a function called WshPipe, but I couldn't get it to work on my work laptop (may just be locked down).

Might be easier to redirect the output of the comspec portion to a temporary text file, then read the info from the file using kix. Then can delete the file.