Maaan...
Why did you have to do that... now you have messed up my script  [Wink]

I removed "$cmd" and " > C:\dsquery.txt"
still worked. [Razz]

but since I trust you guys, I dug a little deeper...

Restarted the server started the console and fired away...
... No go...

now I can't reproduce this even if I put the "$cmd" back and then remove it again.

It won't work without the "$cmd"

conclusion:  You were right... (again...) [Roll Eyes] [Wink]

anyways
It works now, so thanks guys

/V