@echo off echo ------------------------------------------------------------------------------
echo -----------------------修改IIS虚拟目录名称------------------------------------
echo ------------------------------------------------------------------------------ cd %systemroot%\system32\inetsrv\ echo.
echo 请输入完整虚拟站点路径,站点名称+虚拟目录名称(例:Default Web Site/test)
set /p virthPath= rem echo %virthPath% echo.
echo 请输入虚拟站点新名称,直接输入名称,不需要指定在哪个站点下!(例:testNew)
set /p NewPath= rem echo %NewPath% echo.
echo 确认修改吗?请确认输入无误,程序将执行 appcmd set app "%virthPath%" -path:/%NewPath%
set /p y= or : rem echo %y%
echo.
if '%y%'=='' (
appcmd set app "%virthPath%" -path:/%NewPath%
) rem appcmd set app "Default Web Site/tianmashop" -path:/tianmashopNew echo.
echo 如果执行成功,请刷新IIS看效果。
echo. pause
执行效果:
转自:https://www.cnblogs.com/lizhanglong/p/6224924.html