dont even know if this will work in the login script yet, rights etc, trying to get it working on my pc. Maybe I overloaded too may braincells on the script I wrote this morning but I'm having trouble understanding why this is doing what its doing

@echo off
for /f "tokens=5 delims= " %%a in ('netsh interface ip show dns ^| find "DNS"') do set DNSs=%%a && echo hello > \\server\share$\checkdns\%DNSs%-%computername%.txt
output is a file name which contains "hello -ANDY5.txt"

output ought to be a file named which contains "hello"

oh i had a thought & found the rid of the set section and gone with "do echo hello > \\backup\logs$\checkdns\%%a-%computername%.txt"
and now it works for me. I still don't get why it didnt work before...anyone know?