windows开机自启动CMD脚本 python http.server

Windows+R 启动:shell:startup

在其中创建bat脚本 server.bat


@echo off
d:
cd d:\aaa\bbb
python -m http.server 80 --bind 192.168.1.1


在D:\aaa\bbb下为根目录 创建python的web微服务

创建完成后可以先运行bat脚本,验证是否正确。

windows server 管理 记得开启入站规则 TCP 80端口

PS:

http.server 中的 -d 参数可以指定目录

发表回复