GUI for script

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

  1. You can use the ActiveX for "HTTP" 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.
    • HTTP
    • HTTPS
    Put and get file with basic authentication (or without).
Window.AppendMenu(0,"MF_STRING",100,"Get file");
Window.DrawMenuBar();


function WM_COMMAND(id) {
if (id == 100) {
    var ThreadId = TCPIP.HTTP_GET_FILE("http://www.google.com", "c:\\google.html");
    Window.MessageBox("Trace","ThreadId: " + ThreadId, 64);
};
};

function WM_GETFILE(ThreadId, error)
{Window.Delete(1);
 Window.TextOut(1,50,50,"ThreadId: " + ThreadId);
 Window.TextOut(1,50,70,"error: " + error);
 Window.UpdateWindow();
};
var your_cgi = "http://www.www.www/your_cgi.cgi";
var header = "";
var from_file = "c:\\1.txt";

Window.AppendMenu(0,"MF_STRING",100,"Put file");
Window.DrawMenuBar();


function WM_COMMAND(id) {
if (id == 100) {
    var ThreadId = TCPIP.HTTP_PUT_FILE(your_cgi, header, from_file);
    Window.MessageBox("Trace","ThreadId: " + ThreadId, 64);
};
};

function WM_PUTFILE(ThreadId, error)
{Window.Delete(1);
 Window.TextOut(1,50,50,"ThreadId: " + ThreadId);
 Window.TextOut(1,50,70,"error: " + error);
 Window.UpdateWindow();
};
more