> For AI agents: the complete documentation index is available at https://www.tteam.icu/llms.txt, the full documentation bundle is available at https://www.tteam.icu/llms-full.txt.

# bat命令

:::tip
在最开始加上`@echo off`可以确保从文件开始执行起，所有的后续命令都不会显示在屏幕上

在结尾加上`pause`命令可以让脚本程序暂停， 会打印输出 “请按任意键继续...”字样。
:::

## 转发端口

```bat
:: 清除所有转发
netsh interface portproxy reset
:: 把192.168.1.1上的8080转发到本机的80端口
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=80 connectaddress=192.168.1.1 connectport=8080
:: 删除80端口的转发
netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=80
```

## 获取变量/环境变量

```bat
echo %appname%
```
