send a small packet of data via a specific port on an ethernet interface using a batch file

I am using software that listens on serial ports and on ethernet ports for small amounts of data that it translates.
for maintenance purposes i have been periodically sending this software messages via the following syntax in a batch file

@echo on
set /p x="a017 3UNR181OPC00001" <nul >\\.\com17

I am using 2 com ports on an 8 port "Digi Portserver" for this data to be sent to the software. however i now need these ports for another purpose, and i still need to send data periodically to the software.

is it possible to using a similar data format send my message via a specific port on my network?
perhaps somthing similar to the folowing:  

set /p x="a017 3UNR181OPC00001" <nul >\\.\eth0


echo "a017 3UNR181OPC00001" >

or would i be better off virtualizing the ports using some free utility... i am looking for options that don't require an additional Digi portserver.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve KnightIT ConsultancyCommented:
In haven't tried it but told that nc should work.

Using built in maybe telnet:

echo whatever | telnet x.x.x.x yy

though suspect that won't close.

Other than a VBScript should be do-able you can easily open from batch file.  If no-one jumps in will put one together later.

ncat (the successor of netcat, which is a wee bit old) should work. Download the statically compiled file from, unzip it and drop ncat.exe into the script's folder or somewhere in the path.
Then you just pipe data to it:
echo "a017 3UNR181OPC00001"| ncat.exe --send-only localhost 1234

Open in new window

telnet does not accept input over the pipeline; the only way to automate telnet would be with VBScript and sendkeys, which is error prone at best.
Examples are here:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Steve KnightIT ConsultancyCommented:
oBdA - nice, haven't had to do that for probably ten years which is why I thought of netcat!

csePixelatedAuthor Commented:
downloading now, reference the following link

if i should be downloading from somewhere else please let me know, otherwise ill try it and accept working solution inside of 20hrs.
Well, that's the full nmap package; you don't need all of it, you only need the portable ncat.exe.
The link for the one you need is here (second to last paragraph before "Nmap Site Navigation"):
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.