Looks like I fixed it. Finally found the magic search which brought up a similar problem witha php script not ocnnecting to mysql (also socket error).
The fix is to make sure the ioftpd.env has:
Code:
SYSTEMROOT=%[environment(SYSTEMROOT)]
WINDIR=%[environment(WINDIR)]
Also, I had to kill ioftpd.exe and restart it for the change to take effect. After that the ftp.exe connected just fine and worked as it did in cmd.exe.