// Assumes a JPG file is open in Paint.Exe
// Resizes it to 128x128
// Saves it with the same name but in PNG format and extension.
//
var oShell = WScript.CreateObject("WScript.Shell");

oShell.AppActivate("Paint"); // Set focus to open MsPaint program
WScript.Sleep(500);          // Delay for 1/2 second

//=== resize image to 128x128
oShell.SendKeys("%HRE");        // resize dialog box
oShell.SendKeys("%B{RIGHT} ");  // set radio button to pixels
oShell.SendKeys("%M");          // uncheck "Maintain aspect ratio"
oShell.SendKeys("%H128");       // horizontal
oShell.SendKeys("{TAB}128");    // vertical
oShell.SendKeys("{ENTER}");     // OK the dlg box

oShell.SendKeys("%FA");      // File > Save As
WScript.Sleep(500);          // Delay for 1/2 second
oShell.SendKeys("%TP");      // Save as Type "PNG"
WScript.Sleep(500);          // Delay for 1/2 second
oShell.SendKeys("%S");       // save