Windows BAT or CMD: send some data to the local udp port

I have an application that listens on the localhost port. I want the minimal panel to run this application in the foreground.

My application is in Java. I do not know how to write any exe files, but I can write bat files, and then make a shortcut that launches the bat file without showing the terminal. I would like the bat file to send some data to the port (preferably UDP, so there will be no stream overhead).

How to send data to UDP port?

One of the things I was thinking about was nslookup, but it will only connect to port 53, as far as I know.

This is only necessary for working with Windows. I would like it to work on XP and above, but if necessary, I can make a workaround.

+6
source share
3 answers

This is a job for netcat.

http://nc110.sourceforge.net/

After installation, you can easily run it from the command line or write a BAT script to execute it. To send a date using UDP, not TCP, use the -u switch.

For example, to send data to the UPD port 2345 on the local host, do:

nc -u localhost 2345

Then enter the data you want to send.

+5
source

UDP Brightsign netcat. , . , netcat. ( - , SFK, ) . 192.168.1.22 5000

:

- SKF: http://swissfileknife.sourceforge.net/

C:\tools sfk174.exe skf.exe ( ) UDP

C:\tools\sfk udpsend 192.168.1.22 5000 'Special' (, asci . , )

Windows , .

+1

You can send the udp package as follows: c: \ nemesis \ nemesis.exe udp -P do7on.txt -D 192.168.0.10 -y 1025

Nemesis: http://nemesis.sourceforge.net/

0
source

All Articles