本帖最后由 flashercs 于 2022-9-21 10:14 编辑
- 0<1/*,:
- @echo off
- cd /d "%~dp0"
- cscript -nologo -e:jscript "%~f0" "1.csv" "1.txt"
- pause
- exit /b
- */;
- if (WScript.Arguments.length < 2) WScript.Quit();
- var fso = new ActiveXObject('Scripting.FileSystemObject');
- var re = /(?:")([^"]*\.(?:txt|ini|bat|vbs))[^"]*"$/igm;
- try {
- var tsread = fso.OpenTextFile(WScript.Arguments(0), 1, false, -2);
- var str = tsread.ReadAll();
- tsread.Close();
- var tswrite = fso.OpenTextFile(WScript.Arguments(1), 2, true, -2);
- var arr;
- while (null != (arr = re.exec(str))) {
- tswrite.WriteLine(arr[1]);
- }
- tswrite.Close();
- } catch (e) {
-
- }
复制代码
|