Link to home
Start Free TrialLog in
Avatar of csePixelated
csePixelatedFlag for United States of America

asked on

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
EXIT

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 127.0.0.1:1234

or

echo "a017 3UNR181OPC00001" >127.0.0.1:1234

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.
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

In haven't tried it but told that nc should work.

http://www.securityfocus.com/tools/139

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.

Steve
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
oBdA - nice, haven't had to do that for probably ten years which is why I thought of netcat!

Steve
Avatar of csePixelated

ASKER

downloading now, reference the following link

https://nmap.org/dist/nmap-6.49BETA1-setup.exe

if i should be downloading from somewhere else please let me know, otherwise ill try it and accept working solution inside of 20hrs.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial