// helper function to pad zeroes to the left of number function pad(n, len) { var s = n.toString(); while (s.length < len) { s = '0' + s; } return s; } function getMonth(month) { var monthNames = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]; return monthNames[month]; } var date = new Date(); // format timestamp var stamp = pad(date.getDate(), 2) + "-" + getMonth(date.getMonth()) + "-" + date.getFullYear(); var command = 'winscp.com "VisibleThreadServer" /Command "Get /home/visiblethread/VisibleThreadTools/vtbackups/vtbackup_cron_' + stamp + '.tar.gz"'; var shell = WScript.CreateObject("WScript.Shell"); shell.Run(command);