添加发布目录

This commit is contained in:
潘佳 2024-01-04 15:48:12 +08:00
parent bbf29f92de
commit e6c2d30cba

View File

@ -0,0 +1,51 @@
@ECHO OFF
setlocal EnableDelayedExpansion
cd /d %~dp0
::当前目录
set rootPath=%cd%
cd ..
::数据库目录
set dataPath=%cd%\2.database
echo %dataPath%
:::::::::::::::::
set publishedPath=D:\SATLIC.CLOUD.TEST
:::::::::::::::::
::权限检查
net.exe session 1>NUL 2>NUL && (
goto as_admin
) || (
goto not_admin
)
:as_admin
if not exist %publishedPath% md %publishedPath%
::切换目录
cd /d %publishedPath%
::建立数据库
set dname=database
set dfile2=%publishedPath%\%dname%
if not exist %dfile2% mklink /d %dname% %dataPath%
::程序:1
set dname=程序1名称
set dfile2=%publishedPath%\%dname%
if exist %rootPath%\%dname% (
echo %rootPath%\%dname%
if not exist %dfile2% mklink /d %dname% %rootPath%\%dname%
)
echo success ...
goto end
:not_admin
echo not as admin
:end
ping 127.0.0.1 -n 3 >nul
exit