@ECHO OFF
setlocal EnableDelayedExpansion
cd /d %~dp0
set rootPath=%cd%
cd ..
set dataPath=%cd%\2.database
echo %dataPath%
net.exe session 1>NUL 2>NUL && (
goto as_admin
) || (
goto not_admin
)
:as_admin
set dfile=D:\SATLIC.CLOUD
if not exist %dfile% md %dfile%
cd /d %dfile%
set dname=database
set dfile2=%dfile%\%dname%
echo %dfile2%
if not exist %dfile2% mklink /d %dname% %dataPath%
set dname=WebApiUI.ApiCenter
set dfile2=%dfile%\%dname%
if exist %rootPath%\%dname% (
echo %rootPath%\%dname%
if not exist %dfile2% mklink /d %dname% %rootPath%\%dname%
)
set dname=WebApiUI.IoTCenter
set dfile2=%dfile%\%dname%
if exist %rootPath%\%dname% (
echo %rootPath%\%dname%
if not exist %dfile2% mklink /d %dname% %rootPath%\%dname%
)
set dname=WebApiUI.LogCenter
set dfile2=%dfile%\%dname%
if exist %rootPath%\%dname% (
echo %rootPath%\%dname%
if not exist %dfile2% mklink /d %dname% %rootPath%\%dname%
)
set dname=WebApiUI.Ocelot
set dfile2=%dfile%\%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