Arduino Board Communicate with Windows program WiFi

I'm trying to have my Arduino board communicate over WiFi. I assume this is best done through an Ethernet shield. (Creating a kind of server with Arduino, I guess) However, I want the Arduino to send commands to a Windows app. This app will execute some tasks on the computer.

What is the best way to program said app? Using C++? Or perhaps Java? The app needs to execute some console commands. (Run a for loop which iterates through some file on my hard disk) It will start this action when it receives a button press from the Web server.

Any guidance would be super! Thanks in advanced!

One way that I can think of is by using Python (Though I'm sure that it can be done with other languages as well). First, you need to figure out how to run the required 'for loops' which will modify files as per your requirement using Python. If it can be done in a command prompt, you can use this. Or you can search for some other modules in python which suit you.

The other part can be done by either using Python to access data from a web server on which the Arduino modifies the same data as required or alternatively, you can directly communicate to your PC using a Bluetooth module, which would be much faster. Or do you need WiFi specifically?

You want TCP socket communication.

On Arduino side you will use Client object of networking library (EthernetClient, WiFiClient, …). The library must match your hardware - shield or other communication module.

On computer side you will use a socket implementation. In Java it is called Socket.

One side of the communication must run a server listening for incoming sockets communication from the client side. In Arduino networking library the server is implemented as Server object (EthernetServer, WiFiServer, …). Look at the examples of the library.

In Java here is an example of a server implementation.

Choose a programing language you know.