---
title: "（存档）切换web工程上下文脚本"
author: "floydd"
date: "2012-03-10T16:27:01Z"
tags: []
categories: ["编程语言"]
slug: "web"
draft: false
lastmod: "2012-03-10T16:27:01Z"
id: 1449177
url: "https://floydd.iteye.com/blog/1449177"
---

```
@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
```