Question

Is it possible to manage files and directories (i.e. get a directory's content, create/copy/delete files, etc.) usig javascript in WSH ?
I did a quick look at MSDN and I cant find an object that let me do that.

Was it helpful?

Solution

Is FileSystemObject what you're looking for?

OTHER TIPS

var fso = WScript.CreateObject("ScriptingFileSystemObject");
var CurDir = fs.GetFolder("C:\\temp");
var Files = CurDir.Files;
for(var fileitem = new Enumerator(Files); !fileitem.atEnd(); fileitem.moveNext())
{
   fso.CopyFile(fileitem.item(), ExeDir);
}

See MSDN documentation on FSO.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top