I mean that when the command -
SHELL "%comspec% /c dir /s/b $dirarray > directory_tree.txt" - is executed, the txt-file will be overwritten with the new directory structure.

But.., i've got it working now... ripped out the dirarray.

Thanx very much for getting me on the good path !