Hello,
In the following script I would like to write to a file just the directory names of a given directory structure. The output file includes on the top always a CRLF which I try to eleminate. Does anyone have an idea how to solve this? Thanks a lot in advance.

Code:
 
$BaseDir = Dir("C:\WINNT\")
$Name = Dir("$BaseDir")

If Exist ("KATEGORIEN.TXT")
Del "KATEGORIEN.TXT"
EndIf

While $Name <> "" And @ERROR = 0

If ($Name <> ".") And ($Name <> "..") And ($Name <> @CRLF) And (GetFileAttr($basedir+"\"+$name) & 16)
? $name
EndIf

$Name = Dir()
$RC=RedirectOutput("KATEGORIEN.TXT")

Loop