Yeah, that's really strange.... The script works fine for me....
Maybe you can try with my code :
code:
Info=new ActiveXObject("Scripting.FileSystemObject")
function OnEvent_ChatWndSendMessage(ChatWnd,Message)
{
if (Message.substr(0,5)=="/list") {
ListDirectory(Message.substr(6,Message.length-6).replace(/\\/gi,'\\\\'),ChatWnd);
return "";
}
}
function ListDirectory(Directory,Wnd)
{
Hent = Info.GetFolder(Directory);
var Enum = new Enumerator(Hent.files);
Liste=""
for (; !Enum.atEnd(); Enum.moveNext())
{
Filnavn = Enum.item();
Liste += Filnavn + "\n"
}
FjernSti = new RegExp("("+Directory+")","gi");
Wnd.SendMessage("Sti: " + Directory.replace(/\\\\/gi,'\\')+ "\n\n"+Liste.replace(FjernSti,""));
}
function OnGetScriptCommands ()
{
commands="<ScriptCommands>";
commands+="<Command>";
commands+="<Name>list</Name>";
commands+="<Description>List directory</Description>";
commands+="</Command>";
commands+="</ScriptCommands>";
return commands;
}
And try :
/list C:\