2025-03-27 15:05:14 +08:00

114 lines
4.6 KiB
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
cd /d "%~dp0"
set CommandType=%1%
echo -------------------------------------------------
::如果你不想显示创建时的提示请在call的最后加上 >nul 即可。
echo 检查并清理空文件夹...
for /f "tokens=*" %%a in ('dir /b /ad /s %cd%\RealEstate.AppService^|sort /r') do rd "%%a" /q 2>nul
for /f "tokens=*" %%a in ('dir /b /ad /s %cd%\RealEstate.AppWebSite^|sort /r') do rd "%%a" /q 2>nul
echo 检查并创建必要的文件夹......
if not exist RealEstate.AppData md RealEstate.AppData
if not exist RealEstate.AppService md RealEstate.AppService
if not exist RealEstate.AppWebSite md RealEstate.AppWebSite
if not exist RealEstate.Configuration md RealEstate.Configuration
if not exist RealEstate.Plugins md RealEstate.Plugins
if not exist RealEstate.PrintReport md RealEstate.PrintReport
if not exist RealEstate.SoftWare md RealEstate.SoftWare
if not exist RealEstate.Temporary md RealEstate.Temporary
echo 删除存在的文件夹符号链接......
if exist RealEstate.AppWebSite\Configuration rd RealEstate.AppWebSite\Configuration /s /q
if exist RealEstate.AppWebSite\Temporary rd RealEstate.AppWebSite\Temporary /s /q
if exist RealEstate.AppWebSite\SoftWare rd RealEstate.AppWebSite\SoftWare /s /q
if exist RealEstate.AppWebSite\Plugins rd RealEstate.AppWebSite\Plugins /s /q
if exist RealEstate.AppWebSite\PrintReport rd RealEstate.AppWebSite\PrintReport /s /q
if exist RealEstate.AppService\Configuration rd RealEstate.AppService\Configuration /s /q
if exist RealEstate.AppService\Temporary rd RealEstate.AppService\Temporary /s /q
if /i not "%CommandType%" == "" goto Event_Continue1
echo -------------------------------------------------
for /L %%a in (
5,-1,1
) do (
echo %%a 秒钟后继续执行...
ping localhost -n 2 >nul
)
echo -------------------------------------------------
:Event_Continue1
echo 创建文件夹符号链接......
mklink /j RealEstate.AppWebSite\Configuration RealEstate.Configuration >nul
mklink /j RealEstate.AppWebSite\Temporary RealEstate.Temporary >nul
mklink /j RealEstate.AppWebSite\SoftWare RealEstate.SoftWare >nul
mklink /j RealEstate.AppWebSite\Plugins RealEstate.Plugins >nul
mklink /j RealEstate.AppWebSite\PrintReport RealEstate.PrintReport >nul
mklink /j RealEstate.AppService\Configuration RealEstate.Configuration >nul
mklink /j RealEstate.AppService\Temporary RealEstate.Temporary >nul
set Event_Command_Name=""
if exist 01_IISCommand.bat set Event_Command_Name=%cd%\01_IISCommand.bat
if /i %Event_Command_Name% == "" goto Event_Command_Error
:Event_CreateService
echo -------------------------------------------------
echo 创建网站—[7030]牵软网络_数据服务
echo -------------------------------------------------
call "%Event_Command_Name%" /apppool HighWay_AppService v4.0.30319
call "%Event_Command_Name%" /site [7030][贵州交建]_数据服务 7030 %cd%\RealEstate.AppService HighWay_AppService v4.0.30319
:Event_CreateAppSite
echo -------------------------------------------------
echo 创建网站—[8030]牵软网络_应用系统
echo -------------------------------------------------
call "%Event_Command_Name%" /apppool HighWay_AppWebSite v4.0.30319
call "%Event_Command_Name%" /site [8030][贵州交建]_应用系统 8030 %cd%\RealEstate.AppWebSite HighWay_AppWebSite v4.0.30319
echo -------------------------------------------------
if /i not "%CommandType%" == "" goto Event_Continue2
echo 如果您不需要重启IIS服务请直接关闭窗口。
echo 如果您不需要重启IIS服务请直接关闭窗口。
echo 如果您不需要重启IIS服务请直接关闭窗口。
echo 如果您不需要重启IIS服务请直接关闭窗口。
echo 如果您不需要重启IIS服务请直接关闭窗口。
echo -------------------------------------------------
for /L %%a in (
9,-1,1
) do (
echo %%a 秒钟后重启服务...
ping localhost -n 2 >nul
)
echo -------------------------------------------------
:Event_Continue2
echo 重启 ASP.NET状态服务......
net stop aspnet_state>nul
net start aspnet_state>nul
echo 重启 Internet 服务......
iisreset /stop>nul
iisreset /start>nul
echo -------------------------------------------------
echo 完成
goto Event_Command_Pause
::========================命令脚本错误========================
:Event_Command_Error
echo -------------------------------------------------
echo 批处理脚本 01_IISCommand.bat 不存在。
echo -------------------------------------------------
start mshta vbscript:msgbox("批处理脚本 01_IISCommand.bat 不存在。",0,"超图软件")(window.close)
::========================按键结束============================
:Event_Command_Pause
if /i not "%CommandType%" == "" goto Event_Continue3
echo -------------------------------------------------
for /L %%a in (
3,-1,1
) do (
echo %%a 秒钟后关闭...
ping localhost -n 2 >nul
)
::========================结束退出============================
:Event_Command_Exit
@echo on
:Event_Continue3