RunMe_About StartAboutSystemSetupBeforeTesting

:: *****************************************************************************************************************************************************************
:: 20240507
:: 在系统测试开始前,可以用超级管理员CMD窗口运行该脚本.
:: 该脚本功能:可以自动关掉UAC和防火墙,以及可以关掉"系统错误自动重启功能"与开启"Complete memory dump".
:: 缺少的功能: Power Options相关设置部分尚未完成(后续会更新).
:: 作者: Darren Zhang
:: *****************************************************************************************************************************************************************

@echo off

echo.
echo *****************************************************************
echo ************ Start about system setup before testing ************
echo *****************************************************************

:: "About the UAC (EnableLUA) status"
:: "Notes: UAC Disable status:0x0; UAC Enable status:0x1"

:: "Create a SystemFC registry path to mediate subsequent comparisons and copy it to reg_pathFC, and UAC status is off"
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\SystemFC" /v EnableLUA /t REG_DWORD /d 0 /f >nul
set "reg_pathFC="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\SystemFC""
rem reg QUERY %reg_pathFC% /v EnableLUA

:: "Use reg_path to obtain the System registry path"
set "reg_path="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System""
rem REG QUERY %reg_path% /v EnableLUA
echo.

:: "Compare the EnableLUA values of the two paths of the two registries"
REG COMPARE %reg_pathFC% %reg_path% /v EnableLUA >nul
if %errorlevel%==2 (goto DUAC) else (goto DSFC) 

:DUAC
echo ************ Start setting UAC off ************
REG ADD %reg_path% /v EnableLUA /t REG_DWORD /d 0 /f
rem REG QUERY %reg_path% /v EnableLUA
echo.

:DSFC
:: "Delete the SystemFC registry path"
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\SystemFC" /f >nul

echo ************ Turn off Windows Defender Firewall ************
:: Notes: EnableFirewall value : "1" means open ; "0" means close 
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile" /v EnableFirewall /t REG_DWORD /d 0 /f >nul
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\PublicProfile" /v EnableFirewall /t REG_DWORD /d 0 /f 
echo.

echo ************ Turn off Automatically restart and Choose "Complete memory dump" ************
:: Notes: AutoReboot / CrashDumpEnabled value : "1" means open ; "0" means close
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl" /v AutoReboot /t REG_DWORD /d 0 /f >nul
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl" /v CrashDumpEnabled /t REG_DWORD /d 1 /f
echo.

echo ************ Some related Settings for Power options ************
echo "This function is not perfect, please set it manually !"
TIMEOUT /T 30

:EXIT
SHUTDOWN.EXE /R /T 12
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值