给一个批处理脚本》转换结果文件用资源浏览器自动打开指定...
- @set @v=1 /*
- @echo off
- set "txtF="&set/p "txtF=拖入一个简中编码(采用crlf换行符)的文本文件:"
- if not defined txtF exit/b
- (cscript.exe /e:javascript "%~f0" %txtF%)
- set "outF=%txtF%.new"
- if exist %outF% (explorer.exe /select, %outF%)
- exit/b
- */
- var v = WSH.arguments;
- var fso= new ActiveXObject('scripting.filesystemobject');
- var fp = fso.opentextfile(v(0)), all = fp.readall();
- fp.close(); fp = fso.opentextfile(v(0)+'.new', 2, true);
- fp.write(all.replace(/\r\n/g, '\n')); fp.close();
- WSH.quit();
复制代码
|