-2

did try googling this. Someone said a for loop, which I don't know that well.

These 2 in a cmd batch command file:

echo %date% %time% >> "%onedrive%\trackip.txt"
nslookup myip.opendns.com resolver1.opendns.com | Find "Address:" | Find /V "208.67.222.222" >> "%onedrive%\trackip.txt"

puts

timestamp
ip address

on different lines.

I'd like

timestamp  [some spaces] IP address 

each time it runs.

Can anyone help?!

Stephan
  • 53,940
  • 10
  • 58
  • 91
  • (please note that `DOS` and the Windows Command Line (`cmd`) are very different things (although they look alike and share most of their commands, they have some major improvements in `cmd`)) – Stephan Jun 25 '20 at 20:20

1 Answers1

0

Well, for anyone else that needs help, here it is:

echo |set /p=%date% %time% >> "%onedrive%\trackip.txt"
nslookup myip.opendns.com resolver1.opendns.com | Find "Address:" | Find /V "208.67.222.222" >> "%onedrive%\trackip.txt"

Just add

echo | set /p= 

to that first line!? Really!? That's it?

KUDOS TO:

https://www.techjunkie.com/echo-without-newline/

Stephan
  • 53,940
  • 10
  • 58
  • 91