@echo off echo; echo 当前IP地址列表: for /f "tokens=16" %%i in ('ipconfig ^|find /i "ipv4"') do ( set ip=%%i echo %%i ) ::目前是获取所有 ipv4 地址的最后一个 echo; set url=http://%ip%/ echo 生成地址:%url% ::生成快捷方式 @( echo [InternetShortcut] echo URL=%url% echo IDList= )>"系统入口.url"
参考文档:
bat 获取 ip 地址:https://blog.csdn.net/qq_40047088/article/details/86537050
bat 生成快捷方式:https://blog.csdn.net/weixin_33989058/article/details/86082906
bat 循环执行语句:https://zhidao.baidu.com/question/142494649.html
bat 字符串:https://www.cnblogs.com/flay/p/5059259.html
bat 输出空行:https://zhidao.baidu.com/question/751039304703168172.html
bat 注释:https://blog.csdn.net/wh_19910525/article/details/8125762