Open control panel and from there, windows defender firewall.
Click on "Allow an app or feature through windows defender firewall"
click on "allow another app..."
Browse for your Javaw.exe exacutable.
Yes, the one inside your servers launch.bat If it just uses java.exe, it's relying on windows paths, in which case either 32 or 64 bit java is being used, which do you have installed?
Add that
click for both network types, public and private
click close
done.
run server
test if it works, it should.
Possible things you don't know:
What java am I using?
The one you have installed, it usually resides in:
C:\Program Files\Java\jre1.8.0_171\bin
or if it's 32 bit version (no reason to use 32 bit version, really)
C:\Program Files(x86)\Java\jre1.8.0_171\bin
or if you never installed it and are using the one that came with default minecraft client: (not really useful since if you use "open to lan" from single player world, it will use different port each time as I mentioned earlier, making port forwarding a pain. Past this "open to LAN" you don't really need to allow it.)
C:\Program Files(x86)\Minecraft\runtime\jre-x64\1.8.0_51\bin\javaw.exe
jre version and thus folder path might be different for you.