• 常用Dos 命令


    telnet ip 端口号:检查端口是否打开

    netstat -an:查看已打开的所有端口

    ------------------------------------------------------------------------------------------------------

    获取日期和时间

    C:\>echo %date%

    Wed 11/13/2013

    C:\>echo %time%
    12:32:37.89

    C:\>echo %date:~0,3%
    Wed

    %date%是一个参数,后面带的~0,3表示取值范围

    ~表示从环境变量的内容的左边开始,~m,n: m表示从第m个字符开始,n表示取n个字符

    ~0,3意思是从头开始取3个字符,所以为Wed

    C:\>echo %date:~-4%

    2013 

    ~-4: 负数代表倒数,也就取最后4个字符

    C:\>echo %date:~-7,-5%
    13

    ~-7,-5: 取最后7个字符,并且不显示其中最后5个

    C:\>echo %date:~-7,5%
    13/20

    ~-7,5: 取最后7个字符,并且不显示其中前5个

    C:\>echo %date:~-4%-%date:~-7,-5%-%date:~-10,-8% %time:~0,2%_%time:~3,2%_%time:~6,2%

    2013-13-11 12_29_44

    --------------------------------------------------------------------------------------------------------------------------------------------

     Tzutil: Displays the Windows Time Zone Utility. For more details, see http://technet.microsoft.com/en-us/library/hh875624.aspx

      tzutil [/?] [/g] [/s <TimeZoneID>[_dstoff]] [/l]

    ParameterDescription

    /?

    Displays Help at the command prompt.

    /g

    Displays the current time zone ID.

    /s <TimeZoneID>[_dstoff]

    Sets the current time zone using the specified time zone ID. The _dstoff suffix disables Daylight Saving Time adjustments for the time zone (where applicable).

    /l

    Lists all valid time zone IDs and display names. The output will be:

    • <display name>
    • <time zone ID>
  • 相关阅读:
    Thread的run方法和start方法
    35. Search Insert Position
    Error:(1, 1) java: 非法字符: 'ufeff'
    final修饰的变量是引用不可变,还是对象不可变
    数组与练习
    java反射机制【转】
    Socket
    面向对象的设计原则和设计模式
    多线程
    为什么有时候修改了css文件,页面的样式却没有改变?
  • 原文地址:https://www.cnblogs.com/jenneyblog/p/DosCommands.html
Copyright © 2020-2023  润新知