Sorry Jens

syntax in the question but not in the working code.

shell '%comspec% /c ""ndir G: /spa > "C:\ndit.txt"'
should be
shell '%comspec% /c "ndir G: /spa > C:\ndit.txt"'

And can you give me hint in where I can find the 5conspec% info?

Thanks

GP