bat脚本自定义魔兽warIII运行分辨率,去黑边

  我们一般平时安装完WarIII后运行时的分辨率默认是800*600,导致有黑边的存在。所以我写了一个bat脚本来自定义WarIII的运行分辨率。需要以管理员身份运行。

bat脚本自定义魔兽warIII运行分辨率,去黑边_第1张图片

下载链接:

  链接:https://pan.baidu.com/s/1v-ZWjkhkVQTaXunEJs8ThQ
  提取码:m17p

WarIII_Screen_Setting.bat脚本:

@echo off

if not "%OS%"=="Windows_NT" exit
title WarIII Screen Setting
chcp 65001>nul
cd /D %~dp0
echo WarIII Screen Setting
echo ====================================
echo Author:feiquan
echo Create:2019/2/28 10:00
echo UpdataDate:2019/2/28 13:03 
echo Version:1.0v
echo Function:
echo     WarIII Screen Auto Setting
echo           Plese Run as Administrator.
echo           Auto backup WarIII reg to current path warIII_Old.reg .
echo =====================================
pause
cls


setlocal enabledelayedExpansion
set reg_war=hkcu\Software\Blizzard Entertainment\Warcraft III\Video
reg query "%reg_war%" >nul
if not %errorlevel%==0 (
    echo Not find Warcraft III .Please intasll Warcraft III try again .... & timeout /t 5 /nobreak &exit
) else (
    echo Find Warcraft III success.
    echo.
)
echo Current War3 Screen width and height :
for /F "skip=2 usebackq tokens=3" %%i in (`reg query "%reg_war%"  /v reswidth`) do set /a w=%%i & echo W: !w!
for /F "skip=2 usebackq tokens=3" %%i in (`reg query "%reg_war%"  /v resheight`) do set /a h=%%i & echo H: !h!

echo.
set /p question=Do you wart to change WarIII Screen ? (Y/N)
if /i not "%question%"=="Y" exit
echo Start backup WarIII reg :
reg export "%reg_war%" warIII_Old.reg /y  >nul
if %errorlevel%==0 ( 
    echo WarIII_Reg backup to %cd%\warIII_Old.reg 
) else (
    echo WarIII backup defeat.
    set /p question=Do you wart to continue set WarIII Screen ? (Y/N)
    if /i not "%question%"=="Y" exit
)
:setting
echo.
echo Start set WarIII Screen :
set /p SW=Please input WarIII screen width :
set /p SH=Please input WarIII screen height :
echo.
reg add "%reg_war%" /v reswidth  /t reg_dword /d %SW%  /f >nul
if %errorlevel%==0 (
    echo Add new width success. 
) else (
    echo Add new width defeat. 
)
reg add "%reg_war%" /v resheight  /t reg_dword /d %SH%  /f >nul
if %errorlevel%==0 (
    echo Add new heigth success. 
    echo You can restat warIII.
    timeout /t 3 /nobreak
    exit
) else (
    echo Add new heigth defeat. 
    goto setting
)

 

运行结果:

bat脚本自定义魔兽warIII运行分辨率,去黑边_第2张图片

然后重启warIII就可以了。

如果在运行脚本时有任何问题,请在下方留言,我会修正。

转载于:https://www.cnblogs.com/feiquan/p/10449803.html

你可能感兴趣的:(bat脚本自定义魔兽warIII运行分辨率,去黑边)