| @echo off | | echo exit|%ComSpec% /k prompt e 100 B4 00 B0 12 CD 10 B0 03 CD 10 CD 20 $_g$_q$_|debug>nul | | chcp 437 >nul | | graftabl 936 >nul | | echo Welcome to full screen mode... 坚持全屏运行批处理,不动摇、不懈怠、不折腾。 | | ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | | | | ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | | pauseCOPY |
原理讲解:
1、e是debug的修改命令,用于修改内存单元的内容。这里的e 100是编辑ds:0100的内容(这点不详细说了)
2、B4 00 B0 12 CD 10 B0 03 CD 10 CD 20 这些是机器码,这些机器码转化为汇编语言就成了:
MOV AH,00
MOV AL,12
INT 10
MOV AL,03
INT 10
INT 20
这段汇编主要运用了10号中断的00h号功能调用。这里调用了两次,其实一次就可以实现。
MOV AH,00
MOV AL,12
INT 10
INT 20
寄存器AH里的值代表了10号中断的功能调用,这里是00h。如果没记错的话12代表640×400黑白文字。int 20是调用20号中断将控制权交给dos。所谓中断就相当于调用固有的子程序。
3、$_是换行。
4、g是debug的运行命令,q是debug的退出命令。 【方案二】调用XP系统自带的reg命令设置注册表(运行完毕之后会恢复注册表) | @echo off | | if "%1"=="" ( | | goto :FullScreen | | ) | | reg add HKEY_CURRENT_USER\Console /v FullScreen /t REG_DWORD /d %1 /f>nul | | echo Welcome to full screen mode... 坚持全屏运行批处理,不动摇、不懈怠、不折腾。 | | ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | | | | ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | | goto :end | | | | :FullScreen | | set OriginalMode=0 | | for /f "delims=" %%i in ('REG QUERY HKEY_CURRENT_USER\Console /v FullScreen') do ( | | set OriginalMode=%%i | | ) | | set OriginalMode=%OriginalMode:~-1% | | reg add HKEY_CURRENT_USER\Console /v FullScreen /t REG_DWORD /d 1 /f>nul | | start "" %0 %OriginalMode% | | goto :eof | | | | :end | | pause | | exitCOPY |
【方案三】调用临时VBS代码(目的在于摆脱对reg命令的依赖)设置注册表(运行完毕之后会恢复注册表) | @echo off | | if "%1"=="" ( | | goto :FullScreen | | ) | | >"%temp%\RestoreMode.vbs" echo Set WshShell = WScript.CreateObject("WScript.Shell") | | >>"%temp%\RestoreMode.vbs" echo WshShell.RegWrite "HKEY_CURRENT_USER\Console\FullScreen", "%1", "REG_SZ" | | cscript /nologo "%temp%\RestoreMode.vbs" | | echo Welcome to full screen mode... 坚持全屏运行批处理,不动摇、不懈怠、不折腾。 | | ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | | | | ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | | goto :end | | | | :FullScreen | | set OriginalMode=0 | | >"%temp%\BackupMode.vbs" echo Set WshShell = WScript.CreateObject("WScript.Shell") | | >>"%temp%\BackupMode.vbs" echo WScript.Echo WshShell.RegRead ("HKEY_CURRENT_USER\Console\FullScreen") | | for /f %%a in ('cscript /nologo "%temp%\BackupMode.vbs"') do ( | | set "OriginalMode=%%a" | | ) | | >"%temp%\FullMode.vbs" echo Set WshShell = WScript.CreateObject("WScript.Shell") | | >>"%temp%\FullMode.vbs" echo WshShell.RegWrite "HKEY_CURRENT_USER\Console\FullScreen", "1", "REG_SZ" | | cscript /nologo "%temp%\FullMode.vbs" | | start "" %0 %OriginalMode% | | goto :eof | | | | :end | | pause | | exitCOPY |
|