What's wrong with this code?
I'm a complete novice at this so please bear with my ignorance.
I have taken part of some code I know works and simply added a print statemet to it as I want it to print to the command prompt, where I am running the script, the value of REMOTEDIR
Can you please let me know why the addition of the print statement provides an error:
JScript runtime error: Object expected
var date = new Date();
// 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;
// format remote directory name
var REMOTEDIR =
pad(date.getFullYear(), 4) +
pad(date.getMonth()+1, 2) +