常用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]
Parameter | Description |
---|---|
/? |
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:
|
posted on 2013-03-07 17:03 Jenney Zhao 阅读(157) 评论(0) 编辑 收藏 举报