- /*&cls
- @echo off
- set info=互助互利,支付宝扫码头像,感谢打赏
- rem 有问题,可加QQ956535081及时沟通
- title %info%
- cd /d "%~dp0"
- set "folder=#result"
- if not exist "%folder%" md "%folder%"
- dir /a-d/b *.txt|cscript -nologo -e:jscript "%~f0" "%folder%"
- :end
- echo;%info%
- pause
- exit
- */
-
-
- var a=['N1 ;P888', 'N2 G27 G90', 'N3 G00 Z0', 'N4 (UAO,1)'];
- var b=['N7417 G00 M10'];
- var c=['N16256 G00 Z0', 'N16257 G00 X0', 'N16258 G00 Z0', 'N16259 G79X(@XPARK)', 'N16260 Y(@YPARK)', 'N16261 M30'];
- var fso=new ActiveXObject('Scripting.FileSystemObject');
- while(!WSH.StdIn.AtEndOfStream){
- var line=WSH.StdIn.ReadLine();
- WSH.echo(line);
- var file=fso.GetFile(line);
- var f=fso.OpenTextFile(file.path, 1);
- var text=f.ReadAll().replace(/^\s*|\s*$/g,'').split(/\r?\n/),s=[];
- f.Close();
- var s=s.concat(a).concat(text.slice(10,-9)).concat(b).concat(text.slice(-8,-7)).concat(c);
- var f=fso.CreateTextFile(file.ParentFolder.Path+'\\'+WSH.Arguments(0)+'\\'+file.Name, 2);
- f.write(s.join('\r\n'));
- f.Close();
- }
复制代码
|