GUI for script

Do you want to use FTP on the JScript (VBScript) program?

  1. You can use the ActiveX for "FTP" on the standard Windows Script Host shell (wscript.exe).
  2. I can use advanced Windows Script Host shell (engine.exe). I do not use ActiveX.
var host = "ftp.host.com"
var user = "user"
var password = "password"


Window.AppendMenu(0,"MF_STRING",100,"Open FTP");
Window.AppendMenu(0,"MF_STRING",200,"Close FTP");
Window.AppendMenu(0,"MF_STRING",300,"Get Current Directory");
Window.DrawMenuBar();


function WM_FTP(sessionId, type, error, result)
{Window.Delete(1);
 Window.TextOut(1,50,30,"type: " + type);
 Window.TextOut(1,50,50,"sessionId: " + sessionId);
 Window.TextOut(1,50,70,"error: " + error);
 Window.TextOut(1,50,90,"result: " + result);
 Window.UpdateWindow();
};


function WM_COMMAND(id)
{ switch(id){ 
    case 100: TCPIP.FTPConnect(host, user, password, 21, 800);
              break;
    case 200: TCPIP.FTPDisconnect(800);
              Window.Delete(1);
              Window.UpdateWindow();
              break;
    case 300: TCPIP.FTPGetCurrentDirectory(800);
  };
};
more