
我的DOS脚本库
古月印象星空
热爱生活,热爱工作
展开
-
getSubStr
getSubStr.bat源码 @echo off set %0~string=%string% set %0~position=%position% set %0~count=%count% set %0~result= set string=%1 set /a position=%2 set /a count=0 set string=%string:"=% if %p原创 2011-12-05 16:33:37 · 1950 阅读 · 0 评论 -
genSerial
genSerial.bat文件 @echo off set %0~SNFile=%SNFile% set %0~SN=%SN% set %0~result= set SNFile=SN.txt if "%1" =="reset" ( set /a SN=0 goto save ) if exist %SNFile% ( for /f %%i in (%SNFile%)原创 2011-12-05 16:32:02 · 1272 阅读 · 0 评论 -
findFile
findFile查找包含字符串的文件,并列出该字符串在该文件所在的列。 第一参数:要查找的字符串。 第二参数:查找字符串的文件。支持正规表达是。 注1:系统的find命令并不会在子目录中查找,而findFile会在子目录中查找 注2:findFile只会列出包含字符串的文件,而系统的find命令还会列出没有包含字符串的文件。比如:---------- 1.TXT。 使用实例 实例1:原创 2011-12-08 10:45:51 · 4571 阅读 · 0 评论 -
deleteDir
由于windows xp 中没有“deltree”命令了,而rd只能删除空的文件夹,del命令又只能删除文件。 所以只有自己写批处理了。 我在网上找了个删除文件夹的批处理如下: deleteDir.bat文件 @set dir2Delete=%1 @set tempFile=fileTrees.txt @if not exist %dir2Delete% ( @ echo %dir转载 2011-12-17 15:41:27 · 2214 阅读 · 0 评论 -
扫描大图的一个脚本
本脚本用于扫描当前目录下大于50k的图片,输出文件在2.txt. 本脚本的一个应用场景就是对Android工程的res目录进行扫描,对于大于50K大小的图片文件进行预警,避免程序员加入了太大的图片造成最终生产的安装包apk文件过于庞大。 @echo off setlocal EnableDelayedExpansion @if exist 1.txt ( @del 1.txt /q转载 2017-08-21 14:21:00 · 1164 阅读 · 0 评论