欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

windows bat

程序员文章站 2022-05-08 13:14:23
...

startServer.bat

@echo off
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"

sc.exe config LanmanServer start=auto
sc.exe start LanmanServer

sc.exe start com.docker.service

startWsl.bat

Set ws = WScript.CreateObject("WScript.Shell")
ws.run "C:\Windows\System32\bash.exe -c 'sudo /etc/init.wsl'",0
相关标签: 后端 windows