Go into Start > Control Panel > Windows Firewall.
You should see an interface like this, with the firewall being either ON or OFF. For security, it should be ON.
The next step is to add an exception to enable the use of port 5938.
On the Exceptions tab, use [ Add Port ]. Enter the following information:
Name: TeamViewer
Port Number: 5938
(*) TCP( not UDP )
Click [Ok]
When you are done, it will look something like this (this example is for a WebServer on port 80, which is a common exception).
Click [Ok] to close the Windows Firewall configuration dialog. That is all... you are done and you could now retry TeamViewer.
Advanced users many want to automate this by preparing files that change the Windows registry, as explained in this article on Windows Security , from which the screen shots were borrowed.