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

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

程序员文章站 2022-04-06 12:32:19
我们一般平时安装完WarIII后运行时的分辨率默认是800*600,导致有黑边的存在。所以我写了一个bat脚本来自定义WarIII的运行分辨率。需要以管理员身份运行。 下载链接: 链接:https://pan.baidu.com/s/1v-ZWjkhkVQTaXunEJs8ThQ 提取码:m17p ......

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

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

下载链接:

  链接: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运行分辨率,去黑边

然后重启wariii就可以了。

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

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