# ComPortReader
- Download the start.exe app and the config.txt file from the website. 
- If for some reason you don't have config.txt file you can create it from scratch by pasting these text lines in a text file named as config.txt :-
{
    "ComPort": "COM11",
    "BaudRate": 1200,
    "DataBits": 8,
    "Parity": "N",
    "StopBits": 1,
    "HostIP": "localhost",
    "Port": 8000
}
- Both of these MUST be in the same directory if you want the .exe to work. 
- After ensuring the above point you can start the app and check if its working by hitting the ip on the browser to check the response or checking in the task manager. 
- When you ensure that the app is running fine then let's make it self-sustaining via nssm service. 
- Download nssm service installer from nssm.cc
- Extract and run command prompt as admin from the win64 location
- Please ensure that you have started the app once before running these below given commands. 
- Run nssm install 'The name you want your service to have', for example:-
    nssm install comPortReader
- In the GUI that pops up, go to 'Applications Tab'
- Provide the path and it will set the path as well as startup directory automatically. 
- Then in the 'Details Tab' set the same name which have started the command with in the 
    display name and you can add description if you want. 
- Please check in the 'Log On' Tab, local system account is checked or not. 
- Click start service and the GUI will close and then 
- Run this command in the command prompt, nssm start 'The name which you have chosen earlier'

Congrats you have made a service which can restart the app in case of a fatal error or system restart. 

If you want to stop the service just, go to 'services.msc' from win+r option and find your service and then stop it from there. 