1. @ECHO OFF
    2. setlocal EnableDelayedExpansion
    3. cd /d %~dp0
    4. set rootPath=%cd%
    5. cd ..
    6. set dataPath=%cd%\2.database
    7. echo %dataPath%
    8. net.exe session 1>NUL 2>NUL && (
    9. goto as_admin
    10. ) || (
    11. goto not_admin
    12. )
    13. :as_admin
    14. set dfile=D:\SATLIC.CLOUD
    15. if not exist %dfile% md %dfile%
    16. cd /d %dfile%
    17. set dname=database
    18. set dfile2=%dfile%\%dname%
    19. echo %dfile2%
    20. if not exist %dfile2% mklink /d %dname% %dataPath%
    21. set dname=WebApiUI.ApiCenter
    22. set dfile2=%dfile%\%dname%
    23. if exist %rootPath%\%dname% (
    24. echo %rootPath%\%dname%
    25. if not exist %dfile2% mklink /d %dname% %rootPath%\%dname%
    26. )
    27. set dname=WebApiUI.IoTCenter
    28. set dfile2=%dfile%\%dname%
    29. if exist %rootPath%\%dname% (
    30. echo %rootPath%\%dname%
    31. if not exist %dfile2% mklink /d %dname% %rootPath%\%dname%
    32. )
    33. set dname=WebApiUI.LogCenter
    34. set dfile2=%dfile%\%dname%
    35. if exist %rootPath%\%dname% (
    36. echo %rootPath%\%dname%
    37. if not exist %dfile2% mklink /d %dname% %rootPath%\%dname%
    38. )
    39. set dname=WebApiUI.Ocelot
    40. set dfile2=%dfile%\%dname%
    41. if exist %rootPath%\%dname% (
    42. echo %rootPath%\%dname%
    43. if not exist %dfile2% mklink /d %dname% %rootPath%\%dname%
    44. )
    45. echo success ...
    46. goto end
    47. :not_admin
    48. echo not as admin
    49. :end
    50. ping 127.0.0.1 -n 3 >nul
    51. exit