Я пытаюсь перебрать все файлы в моей папке и скопировать что-нибудь из всех файлов Excel внутри.Однако у меня есть проблема с разделением полных путей в функции цикла, поскольку она объединяется в одну строку.
Мне нужно было бы создать подпункт для каждого из путей или файлов.
<script language="JScript">
fso = new ActiveXObject("Scripting.FileSystemObject");
fsofolder = fso.GetFolder("C:/Files");
/* get a collection of the files contained in that folder */
colFiles = fsofolder.Files;
/* Create an Enumerator so that we can move through the collection */
fc = new Enumerator( colFiles );
/* Create a variable to store an output message in */
var msg = "";
/* Loop through the Enumerator and add each item to our variable */
for (; !fc.atEnd(); fc.moveNext() ){
msg += fc.item() + "\n";
}
alert( msg );
</script>