怎么用bat获取公网ip并复制到剪贴板?
发布网友
发布时间:2022-04-24 05:57
我来回答
共1个回答
热心网友
时间:2023-10-05 07:25
复制粘贴到记事本,另存为xx.bat,编码选ANSI
/*&cls
@echo off
rem 获取*/公网IP并复制到剪贴板
set #=Any question&set @=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%@% %z%
for /f %%a in ('cscript -nologo -e:jscript "%~f0"') do set publicip=%%a
if not defined publicip (echo;Failure&goto end)
set port=8080
echo;%publicip%:%port%|clip
echo;Done
:end
echo;%#% +%$%%$%/%@% %z%
pause
exit
*/
var url='##www-bathome-net#s#ip-php'.replace(/#/g,'/');
var http=new ActiveXObject('Microsoft.XMLHTTP');
http.open('GET', 'http:'+url.replace(/-/g,'.'), false);
http.send();
WSH.echo(http.responseText.match(/\d+(?:\.\d+){3}/)[0]);