DOS命令

DOS注释  ==

///定时运行程序

at 19:00 shutdown /f /s /t 6000

//nslookup

nslookup 220.181.108.185 //查询相应IP的信息

///DOS循环命令

@echo off
set i=0
:GOTO
echo %i%
set i=i+1;
ping -n 5 127.0.1  =休眠5秒
goto GOTO

//for循环

for /l %%a in (10001 1 10060) do ( #从10001开始,每次自加1至10060,1可以省
echo %%a
ping -n 5 127.0.1
)

//DOS下的substr

%date:~0,4%  #相当于substr(date, 0, 4)

set t=%time:~3,2%
set /a mod=%t%%%2
if %mod% equ 0 (
echo ‘time mod 2 is 0’%time%
) else (
echo ‘time is’%t%
)

//DOS运行php

c:\php\php.exe “php文件(绝对路径,且php文件里的操作都相对于dos下的当前目录)”