本帖最后由 回家路上 于 2015-7-11 14:27 编辑
回复 5# CrLf
或者处理单个的时候引用VB、JS都行。我这还有的整没
论坛里另一个帖子http://www.bathome.net/thread-33057-1-1.html
找了一个例子,但是不知道怎么往我这里面加了。貌似,cscript命令不能放在bat标签里
- @if (0)==(0) echo off
- set "htmlfile=pom.xml"
- cscript -nologo -e:jscript "%~0" "%htmlfile%"
- pause
- goto :EOF
- @end
- arg = WScript.Arguments;
- with (new ActiveXObject("ADODB.Stream")){
- Mode = 3;
- Type = 2;
- Charset = "utf-8";
- Open();
- LoadFromFile(arg(0));
- s = ReadText(-1);
- s = s.replace(/1\.0\.0-SNAPSHOT/ig, '2.0.0-SNAPSHOT');
- Position = 0;
- WriteText(s);
- SetEOS;
- SaveToFile(arg(0), 2)
- }
复制代码 |