Really ?? I tried with your function, and it works fine....
quote:
Sti: \ <-- Maybe you want to remove that ??? (If you want to keep the path name here, see the function bottom)
AUTOEXEC.BAT
BOOT.BKK
boot.ini
Bootfont.bin
CONFIG.SYS
IO.SYS
MSDOS.SYS
NTDETECT.COM
ntldr
pagefile.sys
sqmnoopt00.sqm
To keep the path name "Sti : C:\", for example :
code:
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,""));
}