@echo off
color 09
title 打开网络中心控制面板 %窗口标题%
@echo -------------------------------------------
@echo -------------------------------------------
@echo -------------------------------------------
@echo --------------这里可以写中文-------------
@echo -------------------------------------------
@echo -------------------------------------------
@echo -------------------------------------------
@echo 正在打开 网络中心 控制面板...
pause
netplwiz
--------------------有选择的模板----·-------------------
@echo
:: H
::
:: Last updated on 2024/06/11
@echo off
%获取管理员权限中%
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
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"
color 2
title Install 关闭防火墙 %窗口标题%
:: NetSh Advfirewall set allprofiles state off #关闭防火墙
:: NetSh Advfirewall set allprofiles state on #打开防火墙
:: Netsh Advfirewall show allprofiles #查看防火墙状态
:menu
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo 欢迎使用H之尘脚本
echo.
echo 请选择项目(关闭、打开防火墙):
echo.&echo 【1】关闭防火墙
echo.&echo 【2】打开防火墙
echo.&echo 【3】查看防火墙
echo.&echo 【4】高级防火墙
echo.&echo 【5】退出
:: echo.
set user_input=""
set /p user_input=请输入数字:
if %user_input% equ 1 goto OFFFHQ
if %user_input% equ 2 goto ONFHQ
if %user_input% equ 3 goto ZTFHQ
if %user_input% equ 4 goto GJFHQ
if %user_input% equ 5 goto Quit
echo 输入错误, 请重新输入数字.
pause
goto menu
:OFFFHQ
NetSh Advfirewall set allprofiles state off
pause
goto menu
:ONFHQ
NetSh Advfirewall set allprofiles state on
pause
goto menu
:ZTFHQ
Firewall.cpl
pause
goto menu
:GJFHQ
WF.msc
pause
goto menu
:Quit
exit
pause
:: XXXXXXXXX
:: XXXXXXXXXXXXXXXXXX
:: Last updated on 2024/07/11
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~分割线~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
标签:pause,goto,CMD,防火墙,echo,set,user,模板
From: https://www.cnblogs.com/hsh622188/p/18281410