Hi SnuZZer,
code:
fso=new ActiveXObject("Scripting.FileSystemObject")
function OnEvent_ChatWndSendMessage(ChatWnd,Message)
{
if (Message.substr(0,5)=="/list") {
Dir=Message.substr(6,Message.length-6);
Dir=Dir.replace(/\\/gi,'\\\\');
ListDirectory(Dir);
return "";
}
}
function ListDirectory(Directory)
{
f = fso.GetFolder(Directory);
var f1 = new Enumerator(f.files);
for (; !f1.atEnd(); f1.moveNext()) {
FileName = f1.item(); // Here's the file name
}
// SubFolders
//var f2=new Enumerator(f.subfolders);
//for (; !f2.atEnd(); f2.moveNext()) {
// ListDirectory(f2.item());
//}
}
function OnGetScriptCommands ()
{
commands="<ScriptCommands>";
commands+="<Command>";
commands+="<Name>list</Name>";
commands+="<Description>List directory</Description>";
commands+="</Command>";
commands+="</ScriptCommands>";
return commands;
}
------------------------------
EDIT : Argh, I'm too slow !!!