How to manage files and dirs under WSH?
-
09-09-2019 - |
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.
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);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow