port - How to list all hosting services on Windows 7?
2014-06
I cannot host on port 80, because there is an application on the background, which hosts on port 80. How do I find out which program it is?
Get local application ProcessID
use port 80:
netstat -aon | findstr "LISTENING" | find /i ":80" | more
var 2:
netstat -aon | find /i ":80" | more
Get application command line:
Wmic process where (ProcessId=<you application ProcessID>) get Commandline, ProcessId
Get service command line:
wmic Service where (ProcessID=<you application ProcessID>) Get Caption, Name, StartMode, State, PathName, ProcessId, StartName
Portqry 2.0 test port 80:
Portqry -local -wport 80 | findstr "LISTENING"
Portqry Support Tools test port 80 UDP and TCP:
Portqry -n 192.168.20.10 -p BOTH -e 80 -i -s
GUI TCPView v3.05:
cmd
:
Far manager:
Far manager get Service command line, PID:
Open command promt and type
netstat -a -n -o
that will show you all open ports and the process IDs associated with them. There you can find the PID which is responsible for port 80 being taken and find that PID in Task Manager.
I'm looking to edit the Windows TCP/IP hosts file (at c:\windows\system32\drivers\etc\hosts
). I'm wondering, what is the best way to do this (on Windows XP)?
Let's say that I want to redirect, say, the site a.com to google.com. I can find the IP address of a.com, but what is the correct way to edit the HOSTS file? I'm thinking of using this syntax:
this.is.ip.address google.com
However, two things:
- Is this the correct syntax? If so, is there a way to do it without having to find the IP address of a.com? Would just putting a.com into where the IP address currently is work?
- What is the best way to edit this file? I can't save to it because it is in use. Normally under these circumstances, I would go into Safe Mode and edit it from there, but is there an easier way (I'm thinking of killing some system processes...)?
One easy way to edit the hosts file is using the freeware Windows program HostsMan.
HostsMan is a freeware application that lets you manage your Hosts file with ease
In Vista / Windows 7 it needs to run with administrative privileges, but it doesn't require going into safe mode.
You can find the IP addresses of the sites using ping
in command prompt or use a lookup tool. Also make sure you tackle all of the combinations:
111.111.111.111 a.com
111.111.111.111 www.a.com
111.111.111.111 222.222.222.222
The file is read only, you can edit it by right-clicking and going into properties, then turning off read-only temporarily until you're done editing.
You should be able to edit the hosts file with Notepad, but it is a protected file by default in Windows Vista. You probably couldn't save the file because of permissions issues, not because it was in use.
To edit the file with Notepad, open it under the Administrator account, by right-clicking Notepad in your Start menu and choosing the Run as Administrator
command.
when I need to edit my hosts file I am copying my hosts file to my desktop then edit it as I want.After editing it I move it to original hosts file's folder and replace the old file.I normally have admin rights while doing this.
Disable AV and edit with notepad. The one thing I find annoying is you are unable to choose ports for those IP address's added in the host. Incase I want to change my web traffic from 80 to 8080 or 4444 for some unknown reason.