@echo off
If not exist manager.xml goto robot
:manager
echo ::Manager
choice /M "switch" /T 2 /D N /C YN
if ERRORLEVEL 2 goto end
goto :torobot
:robot
echo ::Robot
choice /M "switch" /T 2 /D N /C YN
if ERRORLEVEL 2 goto end
goto :tomanager
:tomanager
ren robot.xml robot.xml-
ren demo.xml demo.xml-
ren manager.xml- manager.xml
echo ::Manager
goto end
:torobot
ren robot.xml- robot.xml
ren demo.xml- demo.xml
ren manager.xml manager.xml-
echo ::Robot
goto end
:end
timeout 2

本文介绍了一个使用批处理脚本实现的功能,该脚本可以在两种状态之间进行切换:Manager 和 Robot。通过使用 `IF`、`ECHO`、`CHOICE` 和文件重命名等命令,演示了如何基于用户输入在两种状态间转换。
174

被折叠的 条评论
为什么被折叠?



