Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Normally there's a "services" file in C:\Windows\System32\drivers\etc , it lists out the services running and the port to be used.

However what does the word "service" mean here? It's not the "Windows Service", which could be seen when you run "services.msc". Such 2 lists don't tally.

And, this "services" file content could be outdated -- nobody to update it: programs still can communicate through some port without updating the "services" file, if they have some agreement; also, if some program is not running, some port is not taken, the "Windows services file" is also not updated.

So what is this file for?

Anywhere could I find some documents? Maybe because of the popular file name, I have searched on internet but most links are about "Windows Services"... not this "Windows Services File"...


One more question, since the "services" file can be outdated, is there a way to list out all active "services"?

share|improve this question
up vote 6 down vote accepted

This file tells services written by Microsoft what port to use, as well as files that wish to use Windows APIs and/or that file to turn a service name into a port. These service names are defined by the IETF.

Here is an example of instructions to change a port to make room for another SMTP server.

And here is more explanation about the service names:

servicename [in]

A NULL-terminated string that contains the service name or destination port of the host on which to connect for IPv4 or IPv6.

A service name is a string alias for a port number. For example, “http” is an alias for port 80 defined by the Internet Engineering Task Force (IETF) as the default port used by web servers for the HTTP protocol. Possible values for the servicename parameter when a port number is not specified are listed in the following file: %WINDIR%\system32\drivers\etc\services

MSDN - Winsock - WSAConnectByName function

share|improve this answer
Specifically the services file backs the [getservbyname](‌​8(v=vs.85).aspx) API which translates a service name into a socket number. – Richard Mar 20 '12 at 8:42
@Richard: Perhaps, but it doesn't mention services. – Tom Wijsman Mar 20 '12 at 8:50
so this is a Windows Socket concept? sorry i'm not familiar here... is it that Windows Socket is a protocol lower than HTTP, TCP/IP, FTP, so that definition done in Windows Socket level can regulate behaviour on HTTP, TCP/IP, or FTP level? – athos Mar 20 '12 at 8:50
@athos: No, it's no protocol. Windows services just first translate the service name (eg. http) into the service port (eg. 80 for http), then provide that service port to the relevant protocol (TCP/IP). – Tom Wijsman Mar 20 '12 at 8:51
Sidenote: The naming, usage and format of this file comes from Unix where the file is /etc/services. Microsoft adopted this when they started to replace their proprietary networking protocol Netbeui with the open-source TCP/IP protocols that were becoming more important. See – RedGrittyBrick Mar 20 '12 at 9:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .