@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