How to make "streamlit run example.py" run as a service or system task in windows?

If “streamlit run example.py” can run as a service or system task in windows,
web page can be more stable and we do not have to open a cmd window anymore.

You can save your start command in a batch (.bat) file and use the windows task scheduler to run this on startup or login. If you are working with anaconda/conda and have to activate an environment first, you may use something like this to start the server at a predefined tcpip port:

C:\develop\anaconda\Scripts\activate.bat C:\develop\anaconda\envs\std3 & streamlit hello --server.port 8505

Here the path to my conda install is C:\develop\anaconda and I am activating an env named std3. Notice the ‘&’ which chains the commands! Use full absolute paths. Starting the bat at boot time may involve playing with the access rights on files