生成某种文件的路径列表
摘要:for /r "F:\Temp" %%a in (*.bat) do echo %%a>>.\list.txt
阅读全文
posted @
2016-10-18 16:29
思静
阅读(203)
推荐(0)
路由命令
摘要:ipconfig tracert -d 192.168.1.55 route add [IP] mask [Mask] [Gateway] route add 192.168.1.88 mask 255.255.255.0 192.168.1.1 ping 192.168.1.55
阅读全文
posted @
2016-01-28 17:28
思静
阅读(172)
推荐(0)
删除文件,保留最近多少个文件
摘要:@set LogDir=D:\Log for /f "skip=10" %%i in ('dir %LogDir%\apache-access-*.log /tc /o-d /b') do del %LogDir%\%%i
阅读全文
posted @
2015-08-10 17:47
思静
阅读(236)
推荐(0)
批处理警惕等号前面的空格
摘要:批处理警惕等号前面的空格, 不然赋不了值 set aa=dd set aa = dd
阅读全文
posted @
2015-05-28 12:03
思静
阅读(214)
推荐(0)
删除子目录,除了某个目录
摘要:@echo %date%
@Set Year=%date:~10,4%
@Set Month=%date:~4,2%
@Set Day=%date:~7,2% @Set CurrentDate=%Year%_%Month%_%Day% @set BaseDir=D:\temp
echo %CurrentDate% rem 删除%BaseDir% 下的子目录,除了 %CurrentDa...
阅读全文
posted @
2015-03-30 14:09
思静
阅读(273)
推荐(0)
当前目录
摘要:@set curPath=%~dp0
cd /d %curPath%
阅读全文
posted @
2015-03-10 09:49
思静
阅读(133)
推荐(0)
批处理 Mysql Findstr
摘要:@set Dump_IP=localhost@set User_Name=root@set Password=1234@set curPath=%~dp0mysql -h %Dump_IP% -u%User_Name% -p%Password% -e "show slave status\G">%curPath%Slave_Status.txt@Rem find any row of Sla...
阅读全文
posted @
2014-04-15 14:10
思静
阅读(602)
推荐(0)
等待几秒的批处理
摘要:@Echo Please wait 1 minute, do not close the window... @ping -n 60 127.0.0.1>nulpause
阅读全文
posted @
2014-04-01 10:55
思静
阅读(1143)
推荐(0)
批处理,生成当前时间
摘要:@echo %date%@Set Year=%date:~0,4%@Set Month=%date:~5,2%@Set Day=%date:~8,2%@Set CurrentDate=%Year%-%Month%-%Day%@echo %CurrentDate%pause
阅读全文
posted @
2014-03-12 02:29
思静
阅读(358)
推荐(0)
批处理-当前日期
摘要:REM 通过%date:~5,2%来组合得出当前日期,组合的效果为yyyymmdd,date命令得到的日期格式默认为yyyy-mm-dd(如果不是此格式可以通过pause命令来暂停命令行窗口看通过%date:~,20%得到的当前计算机日期格式),所以通过%date:~5,2%即可得到日期中的第五个字符开始的两个字符,例如今天为2009-02-05,通过%date:~5,2%则可以得到02。(...
阅读全文
posted @
2013-03-13 10:28
思静
阅读(2926)
推荐(0)