This is a lenghty post, I understand, but my problem requires a healthy level of detail to convey, and I'm sure requires a formidable knowledge to address.

What I want to ultimately do is FTP a file to an OS/390 mainframe, trigger a JCL script, and download the results. Since the mainframe is EBCDIC (instead of ANSI ASCII), the FTP session requires a SITE QUOTE command to do the conversion, another one to allow me to trigger the JCL job, and another one to set the file access back to normal.

I can find VB's API calls for FTP put and get, but I need to use site. If there is an API call for that, then all of my problems are solved.

Since I don't know of one, I am spawning a CMD /C and telling it to run an ftp /s with an input file. Since the CMD starts with no evironmental variables set (such as path), I have to explicitly say C:\Winnt\System32\ftp.exe /s et al. Spawning the CMD this way (with CreateProcess&()), I wait for it to exit (using the handle returned in CreateProcess&() in WaitForSingleObject&()).

To trouble shoot, I am using CMD /K and setting the focus to normal (calling the CMD with CreateProcess&()). I get to see the ftp session say, "mainframe.usps.gov: Unknown host". I fear that it is not resolving the name lookup correctly (if that makes any sense).

I'm hoping someone has an idea, and I'm including a bit of code if it will help:

Code:
Dim strCmdLine As String
    strCmdLine = "C:\WINNT\System32\cmd.exe /K C:\WINNT\system32\ftp.exe -n -s:" & App.Path & "\ftp.txt mainframe.usps.gov"

lngRETVAL = CreateProcess&(vbNullString, strCmdLine, 0, 0, 1, NORMAL_PRIORITY_CLASS, 0&, vbNullString, udtStartupInfo, udtProcessInfo)
lngRETVAL = WaitForSingleObject&(udtProcessInfo.hProcess, -1)
lngRETVAL = CloseHandle&(udtProcessInfo.hProcess)
If anyone has any specific questions, and think they can help, just ask. I can't send but so much of the project since all the machines are hidden behind the firewall and I do have proprietary interests to consider (but I am open source at heart).

Many thanks in advance,
Travis