Since posting this I learned a little more; you don't need to use "new ActiveXObject" really; this is neater:
var fs = WScript.createObject("Scripting.FileSystemObject");
I think the other method is just a little old-fashioned; it does work but I prefer this method.