lennyli 50 Newbie Poster

I fixed the problem by ensuring the path is including python. Also on the server I must run pip install
Thank you all
All working now

Salem commented: Good job! +16
lennyli 50 Newbie Poster

When I run the command "python server.py" on the server pc, it held for a second, then released back to the command prompt.

So did it even give you print("Waiting for a connection...") ?

Consider making your server main like this.

if __name__ == "__main__":
    print('Server Begin')
    main()
    print('Server End')

You can add more prints in the main() function itself to try and diagnose the point of failure.

Your client failed with the timeout because your server isn't running.

A very basic test: At the console prompt on your client machine, type ping 192.168.0.2

i can ping 192.168.0.2 successfully, but as i said disappointingly the python server.py command didnt output any text before returning control to command prompt even if i added the suggested code print('server begin').
Could it be due to some modules/libraries missing/not installed??

I ran the command echo %PATH% and the output did not have the word "python" anywhere. Even if i run the setup and ticked the option "add to path", the echo %PATH% command didnt seem to show what i expected.

lennyli 50 Newbie Poster

Pritaeas answered the question: normal WEB security settings forbids launching executables on a client machine. The only legal workaround is to create windows service (daemon in Linux environment), install it on client machine and listen for some commands coming from server over WEB sockets.

Sure, I understand, but for my above new program it has nothing to do with web. It is just a python script but it still doesnt work. Do you have any insight or clue what is wrong?

rproffitt commented: "IIS" is a web server. And again a browser will not launch notepad.exe +17
gediminas.bukauskas.7 commented: You need to update IIS security settings, enable CGI mode. These operations will allow to run EXE on machine where IIS is installed. +0
lennyli 50 Newbie Poster

I see pritaeas has answered so I'll move to the next stage of the discussion which is to ask what you need in your web site.

For example there is an "online notepad" which does some basic notepad work. And there are many screensavers that run from a webpage with an example at whitescreen.online .

You can get there.

Actually it has nothing to do with screensaver or notepad. My boss just asked me to create a prototype as proof of concept. There is no specific language/tool I must use. The prototype is to demonstrate that I can wirelessly control a hardware product with its own computer touch screen. My thought is that the hardware product can be seen as a notebook computer that has a web server installed. It is connected only to a wifi router without internet connection. Its IP is set to be 192.168.0.2 whereas the router being 192.168.0.1. My computer will use wifi to connect to the SSID of the router connected to the product. My thought is maybe to demonstrate that i can use my web browser to connect to the webpage http://192.168.0.2. If I click a button on that HTML page, it can run something, such as a ribbon screensaver. My boss also wanted me to setup demo so that not only the remote execution runs, but i can at the same time, run a local program similar or same as the software on the remote notebook (eg, a screen saver).

rproffitt commented: Until you understand that you can't launch .exe's on my PC from a web page, we have to wait for you to catch up. +17
lennyli 50 Newbie Poster

I have tried to read https://www.daniweb.com/programming/web-development/threads/386380/cannot-run-exe-files-in-asp-net-application but still lost in trying to achieve something. I installed the latest .net framework, and IIS on the latest updated windows 11. I wish to achieve the following:
Have a webpage with a button, when pressed, it will launch a webpage that runs a server side exe (eg, notepad.exe or ribbons.scr), while at the same time run the same exe on the local client pc.
For my attached source files, i dont know why the index.cshtml doesnt show a button. Also disappointingly the notepad.exe did not run even when i set it to have security permissions so let everyone have all rights. im a little confused why there were 2 web.config files, and the IIS interface didnt seem to match the web.config settings, and also i dont understand why the visual studio code will launch the site with a certain port number, while your previous discussion 13 years ago suggested to use the session state to run at a different port.
Thank you for reading!