Re: echo dos command problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Force a blank line like so:

echo. >> C:\WINDOWS\system32\drivers\etc\hosts
echo 10.190.10.10 server1.test.com >> C:\WINDOWS\system32\drivers\etc\hosts
echo 10.190.10.11 server2.test.com >> C:\WINDOWS\system32\drivers\etc\hosts
echo 10.190.10.12 server3.test.com >> C:\WINDOWS\system32\drivers\etc\hosts

"Dan Liu" <DanLiu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BEB65BC2-EB93-446B-B23F-FBCD37530BDF@xxxxxxxxxxxxxxxx
sorry, what I mean is when I run my batch, the three entries added to the
host table, but first entry added after localhost ( not added in a new
line
), what I want is all three entries added to the host table in individual
line

unexpected result after run the batch
127.0.0.1 localhost10.190.10.10 server1.test.com
10.190.10.11 server2.test.com
10.190.10.12 server3.test.com


expected result after run the batch
127.0.0.1 localhost
10.190.10.10 server1.test.com
10.190.10.11 server2.test.com
10.190.10.12 server3.test.com

My question is, what command can I use for make sure call entries added in
new line.

Thanks again


"Pegasus (MVP)" wrote:


"Figo" <figo@xxxxxxxxx> wrote in message
news:ehoRS73QIHA.1164@xxxxxxxxxxxxxxxxxxxxxxx
hi all, I would like to use below command for adding entries to host
table,

echo 10.190.10.10 server1.test.com >>
C:\WINDOWS\system32\drivers\etc\hosts
echo 10.190.10.11 server2.test.com >>
C:\WINDOWS\system32\drivers\etc\hosts
echo 10.190.10.12 server3.test.com >>
C:\WINDOWS\system32\drivers\etc\hosts

but I want to ensure the new entry is in individual line

since I encounter this problem after I run the batch

127.0.0.1 localhost10.190.10.10 server1.test.com

so, I would like to know if there has a solution, thanks a lot




.



Relevant Pages