常见Windows问题

Posted strongiwan

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了常见Windows问题相关的知识,希望对你有一定的参考价值。

端口占用问题:

1.查看指定端口占用情况

    C:>netstat -ano|findstr "2003"
    TCP    127.0.0.1:2003         127.0.0.1:2003         ESTABLISHED     1488

     PID为1488的进程占用了端口2003

   涉及命令:netstat

    

netstat -a  显示所有连接和监听端口

Active Connections--动态监视当前一层设备使用的TCP/IP协议
  Proto  Local Address          Foreign Address        State
  TCP    0.0.0.0:21             1371155-pc01:0         LISTENING
  TCP    0.0.0.0:22             1371155-pc01:0         LISTENING

netstat -b  显示在创建每个连接时所涉及的可执行文件
  
   Proto     Local Address              Foreign Address           State
    [vmnat.exe]
     TCP    10.72.0.237:56250      220.181.7.165:http     ESTABLISHED
    [avp.exe]
     TCP    10.72.0.237:58242      bdc:microsoft-ds       ESTABLISHED
    [Skype.exe]
     TCP    127.0.0.1:64108        1371155-pc01:nfsd-status  ESTABLISHED
    [Snip.exe]
     TCP    127.0.0.1:64236        1371155-pc01:5939      ESTABLISHED

netstat -e 以太网统计  常跟  -s 一起使用
    Interface Statistics                  Received            Sent
    Bytes                                   3673594919      3771384203
    Unicast packets                    125478144        112250667
    Non-unicast packets              24162192         8191326
    Discards                               0                      0
    Errors                                   0                      0
    Unknown protocols                0                    

netstat -f   显示完全限定域名
    TCP    10.72.0.237:49246      ksfile.foxlink-cn.com:microsoft-ds  ESTABLISHED
    TCP    10.72.0.237:49484      1371155-pc01.foxlink-cn.com:microsoft-ds  ESTABLISHED
    TCP    10.72.0.237:93210      270.111.7.195:http     ESTABLISHED
    TCP    10.72.0.237:98343      bdc.foxlink-cn.com:microsoft-ds  ESTABLISHED


netstat -n    以数字形式显示地址和端口号
    Proto  Local Address             Foreign Address          State
    TCP    10.72.0.237:445        10.72.0.237:49484      ESTABLISHED
    TCP    10.72.0.237:445        10.72.0.244:52741      ESTABLISHED

netstat -o  动态显示与每个连接相关的所属进程 ID
    Proto   Local Address               Foreign Address        State           PID
     TCP    10.72.0.237:49246      ksfile:microsoft-ds    ESTABLISHED     4
     TCP    10.72.0.237:49484      1371155-pc01:microsoft-ds  ESTABLISHED     8200
     TCP    10.72.0.237:56250      220.181.7.165:http     ESTABLISHED     1612

    
netstat  -p proto   proto可以是IP、IPv6、ICMP、ICMPv6、TCP、TCPv6、UDP 或 UDPv6 , 与 -s 连用就是字节数据统计
    例子:netstat -p tcp
     Proto  Local Address             Foreign Address             State
     TCP    10.72.0.237:445        1371155-pc01:49484     ESTABLISHED
     TCP    10.72.0.237:445        1371219-pc01:52741     ESTABLISHED


netstat -r  路由表
    Active Routes:
    Network Destination        Netmask          Gateway       Interface  Metric
     127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
     119.233.0.0      255.255.0.0         On-link    169.234.245.73    236
     119.214.0.0      255.255.0.0         On-link   169.234.196.155    236
     119.254.196.155  255.255.255.255         On-link   169.234.136.135    276
      ===========================================================================
Persistent Routes:
  Network Address          Netmask  Gateway Address  Metric
          0.0.0.0          0.0.0.0      10.72.0.239  Default
===========================================================================

IPv6 Route Table
===========================================================================
Active Routes:
 If Metric Network Destination      Gateway
  1    306 ::1/128                  On-link
  1    306 ff00::/8                 On-link
===========================================================================
Persistent Routes:
  None
  
netstat -s 显示按协议统计信息。默认地,显示 IP、 IPv6、ICMP、ICMPv6、TCP、TCPv6、UDP 和 UDPv6 的统计信息

IPv4 Statistics
  Packets Received                   = 33071337
  Received Header Errors             = 6759793
  Received Address Errors            = 1045341
  Datagrams Forwarded                = 0
  Unknown Protocols Received         = 0
  Received Packets Discarded         = 181799
  Received Packets Delivered         = 26327404
  Output Requests                    = 24167958
  Routing Discards                   = 0
  Discarded Output Packets           = 241114
  Output Packet No Route             = 1
  Reassembly Required                = 0
  Reassembly Successful              = 0
  Reassembly Failures                = 0
  Datagrams Successfully Fragmented  = 0
  Datagrams Failing Fragmentation    = 0
  Fragments Created                  = 0

netstat -t  显示当前连接卸载状态
    Proto  Local Address          Foreign Address        State           Offload State
     TCP    127.0.0.1:61546        1371155-pc01:nfsd-status  FIN_WAIT_2      InHost
     TCP    127.0.0.1:62024        1371155-pc01:nfsd-status  ESTABLISHED     InHost

  

2.通过PID查看进程名称

  C:>tasklist|findstr "1488"
  test.exe                      1488 Console                    1        212 K
  

tasklist /v|findstr "Skype.exe"  显示详细信息

ImageName     PID        Session Name     Session# Mem Usage    Status        User Name      CPU Time   Window Title
Skype.exe     2304        Console           1      122,032 K    Running	    FOXLINK1371155   0:14:05       Skype                           
Skype.exe     5700        Console           1      52,496 K     Unknown	    FOXLINK1371155   0:05:27       N/A
Skype.exe     1756        Console           1      6,244 K      Unknown	    FOXLINK1371155   0:00:00       N/A                           
Skype.exe     7220        Console           1      203,988 K    Running     FOXLINK1371155   0:16:14       Rtc Video PnP Listener                           
Skype.exe     6692        Console           1      1,964 K      Running     FOXLINK1371155   0:00:00       crash service                           
Skype.exe     5768        Console           1      5,648 K      Unknown     FOXLINK1371155   0:00:00       N/A

利用进程的PID结束进程
命令格式:ntsd -c q -p pid
命令范例: ntsd -c q -p 1332 (结束explorer.exe进程)
利用进程名结束进程
命令格式:ntsd -c q -pn ***.exe (***.exe 为进程名,exe不能省)

3.结束进程

  C:>taskkill /f /t /im test.exe

 4.打印机无法打印

a. cmd 下输入services.msc 启动Windows服务管理器
b.找到print spooler打印机服务做重启操作----确保服务正常
c.保证已经安装正确版本打印机驱动
d.PC -> 打印机  两者间网络必须联通

5.输入法小事

a. CMD下输入ctfmon.exe 重新执行此程序
b.控制面板->语言->区域和语言->文本服务和输入语言设置对话框->常规重新选一下输入法->语言栏选择停靠于任务栏

6.添加FTP/Telnet等其他程序

a. cmd下输入appwiz.cpl -> 打开或关闭Windows程序(这些程序采用的是易插拔的理念,本来就存在系统中)

  

 




以上是关于常见Windows问题的主要内容,如果未能解决你的问题,请参考以下文章

覆盖一个常见的片段帮助其他标签片段

Android 实用代码片段

Android 实用代码片段

视图或片段库为常见数据类型组成 UI

13 个非常有用的 Python 代码片段

使用 Git 来管理 Xcode 中的代码片段