本帖最后由 zaqmlp 于 2019-4-3 10:56 编辑
- /*&cls
- @echo off
- set info=互助互利,代码可用,支付宝扫码头像,感谢赞助
- rem 有问题,加QQ956535081及时沟通
- title %info%
- start mshta VBScript:Execute("msgbox(""%info%""):close")
- cd /d "%~dp0"
- for /f %%a in ('dir /a-d/b "123.txt" "456.txt"^|cscript -nologo -e:jscript "%~f0"') do (
- ping %%a
- )
- pause&exit /b
- */
- var fso=new ActiveXObject('Scripting.FileSystemObject');
- while(!WSH.StdIn.AtEndOfStream){
- var file=WSH.StdIn.ReadLine();
- if(fso.FileExists(file)){getip(file);}
- }
- function getip(file){
- var f=fso.OpenTextFile(file,1),text='';
- text=f.ReadAll();
- var m=text.match(/(\binet\s+addr:|\bwlan0\s+UP\s+)\d+\.\d+\.\d+\.\d+/g);
- f.Close();
- for(var i=0;i<m.length;i++){WSH.echo(m[i].replace(/^.*?(?=\d+\.\d+\.\d+\.\d+)/,''))}
- }
复制代码
|