China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-07 07:29
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » About the selection of various methods to achieve P full screen [slore to solve the networking problem] View 2,646 Replies 15
Original Poster Posted 2007-09-22 04:30 ·  中国 广东 广州 白云区 电信
初级用户
★★
Credits 172
Posts 54
Joined 2007-01-02 10:38
19-year member
UID 75260
Gender Male
Status Offline

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


This is the code everyone knows to achieve full screen. After using it, the following problems are found:
1. The font appearance after achieving full screen is very poor, and it has a feeling of being squashed.
2. The movement of the cursor will be fully displayed, and it doesn't look good when the space is output and the cursor is displayed.
3. The most serious problem is that ping can reach the external network, but VBS network connection cannot be used.
For example, the VBS for downloading web page source code in CMD cannot be used in this full screen mode, which I have tested.
4. It seems that Kaspersky reports "changing the input and output direction..."

The second method to achieve full screen:
Press ALT+ENTER, this is also known to everyone. Using this method, there are none of the four problems mentioned above. However, everyone doesn't know if there is a way to use ALT+ENTER full screen automatically without manual pressing.

The third method to achieve full screen:
This is a permanent full screen. Modify the following registry key value:

HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe
"FullScreen"=dword:00000001

If there is no such sub-item %SystemRoot%_system32_cmd.exe, then create one.
The full screen mode achieved by this method has exactly the same effect as the second one, except that the full screen is permanent, unless you change the value of FullScreen to 0.

Then can the batch file change the value of FullScreen in the registry at the beginning?
The answer is yes, but the memory of the batch program opened at the beginning will not be refreshed
That is to say, even if you change the registry at the beginning, full screen cannot be achieved. It will be achieved when the batch is started next time. So I hope that experts can solve this problem.

What I want is to achieve full screen without the second run, or someone tells me that this is forever impossible, so that I can give up, but there must be basis.

---------------------------------------------------------------
The preliminary solution is seen in building 13
Defect: I found that there was a problem with the network connection when using the method of modifying the registry. The specific details are in the following post:
http://www.cn-dos.net/forum/viewthread.php?tid=33750&fpage=1

[ Last edited by dosmania on 2007-9-23 at 08:07 PM ]
Floor 2 Posted 2007-09-22 13:06 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
Both need to be run twice... Didn't you see exit and %ComSpec% in the debug you sent?
Floor 3 Posted 2007-09-22 18:37 ·  中国 广东 广州 电信
初级用户
★★
Credits 172
Posts 54
Joined 2007-01-02 10:38
19-year member
UID 75260
Gender Male
Status Offline
I know that it needs to be run twice.
Using start to start a new window to run the batch file itself will re-read the registry - related settings,
so the window started by start will be full - screen
The problem is, how to close the original window after starting a new window with start
This is a way to deceive people. The main thing is that I don't want to close it and then open it again to achieve full - screen.
Floor 4 Posted 2007-09-22 19:06 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
Give BAT a parameter...

Judge whether it is the first time or the second time through the parameter...

When there is no parameter, modify the registry... Then exit and call itself + parameter
Floor 5 Posted 2007-09-22 20:53 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Originally posted by slore at 2007-9-22 19:06:
Give a parameter to BAT...

Determine through the parameter whether it is the first time or the second time...

When there is no parameter, modify the registry... and then exit to call itself + parameter

No need to judge the first time or the second time, just use REG QUER to judge whether there is the key value to handle

Example
REG QUERY HKEY_CURRENT_USER\Console /s|findstr "FullScreen"
Floor 6 Posted 2007-09-22 23:15 ·  中国 北京 网联光通
初级用户
★★
Credits 128
Posts 59
Joined 2007-09-15 23:03
18-year member
UID 97496
Gender Male
Status Offline
The landlord is also a person who cares about details, haha, learn something
Floor 7 Posted 2007-09-23 00:24 ·  中国 广东 广州 电信
初级用户
★★
Credits 172
Posts 54
Joined 2007-01-02 10:38
19-year member
UID 75260
Gender Male
Status Offline
TO all above:


REG QUERY HKEY_CURRENT_USER\Console /s|findstr "FullScreen"

Such code I still can't judge it... Actually you made a mistake here

REG QUERY HKEY_CURRENT_USER\Console\%%SystemRoot%%_system32_cmd.exe /s|findstr "FullScreen"

This is correct!

Don't just have a bunch of theories, everyone. You should actually test it to see if your theories work.
Judge FullScreen, then if it exists, no need to change it; if it doesn't exist, change it. Generally, there is no full screen.
Then we don't care whether it originally exists or not, just directly change FullScreen to 1.
It's just that you modify the registry after running the batch script. Then you need to read the Fullscreen in the registry before running the batch script. If it was originally 0, your batch script will run in the default window. Then how you change the registry later will only take effect when the batch script runs next time or start a batch script, then you can achieve full screen. Just how to close the original batch script!

[ Last edited by dosmania on 2007-9-23 at 01:16 AM ]
Floor 8 Posted 2007-09-23 03:21 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Originally posted by dosmania at 2007-9-23 00:24:
TO all above:


REG QUERY HKEY_CURRENT_USER\Console /s|findstr "FullScreen"

I can't even judge such code... Actually you made a mistake here
...

I have noted "Example", so it's for reference only

Just like the execution command of slore, judge the "FullScreen" value. If it is not "1", change it to "1", and start "" "%~nx0"&&exit (automatically start the second time after exiting)
If the "FullScreen" value is "1", do not execute the modification command and start "" "%~nx0"&&exit

[ Last edited by zh159 on 2007-9-23 at 03:22 AM ]
Floor 9 Posted 2007-09-23 09:04 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
dosmania:
Don't be too serious...

You are the "wrong" one...
Maybe the running environment is different, directly in the console under XP system...

But one point I want to make is that my meaning is not to judge the registry...

if "%1"=="" goto FullScreen:
Code in full-screen mode...

Goto EOF
:FullScreen
Change the registry FS to 1 here, then exit, and then call yourself casually with a parameter...


To do it well, pass the read registry value to your P, and restore it to the default value at the end of P


(If convenient, directly package a shortcut... Set the CMD startup in the shortcut to full-screen)
Floor 10 Posted 2007-09-23 12:34 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Brother slore's idea is really brilliant
@echo off
if "%1"=="" goto :FullScreen
echo welcom to full screen
pause

goto :eof

:FullScreen
reg add HKEY_CURRENT_USER\Console /v FullScreen /t REG_DWORD /d 1 /f
start "" "%0" 1
exit
Floor 11 Posted 2007-09-23 13:40 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
HAT got my meaning...

Well, write a complete one~

@echo off
if "%1"=="" goto :FullScreen
::Restore display mode
reg add HKEY_CURRENT_USER\Console /v FullScreen /t REG_DWORD /d %1 /f>nul

::Code segment in full screen state
echo Welcome to Full Screen
pause
goto :EOF

:FullScreen
::Query display mode
Set ShowMode=0
for /f "delims=" %%i in ('REG QUERY HKEY_CURRENT_USER\Console /v "FullScreen"') do (
Set ShowMode=%%i
)
Set ShowMode=%ShowMode:~-1%
::Set display mode to full screen
reg add HKEY_CURRENT_USER\Console /v FullScreen /t REG_DWORD /d 1 /f>nul
::Start current Bat script in full screen
start "" "%0" %ShowMode%
exit
Floor 12 Posted 2007-09-23 13:51 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
Not bad, but the %0 in the second-to-last statement doesn't need double quotes. If %0 contains spaces, cmd will automatically preprocess it into a path with double quotes added. Adding double quotes will instead easily cause errors.
Recent Ratings for This Post ( 2 in total) Click for details
RaterScoreTime
dosmania +1 2007-09-23 17:28
HAT +5 2007-09-23 21:39
Floor 13 Posted 2007-09-23 14:11 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
Hehe, that was directly copied...
Hmm, I found that EOF doesn't exit in full screen... I made some changes...



  1. @echo off
  2. if "%1"=="" goto :FullScreen
  3. ::Restore display mode
  4. REG Add HKEY_CURRENT_USER\Console /v FullScreen /t REG_DWORD /d %1 /f>nul

  5. ::Code segment in full screen state
  6. echo Welcome to Full Screen
  7. echo Press any key to exit...
  8. pause>nul
  9. Goto :End

  10. :FullScreen
  11. ::Query display mode
  12. Set ShowMode=0
  13. for /f "delims=" %%i in ('REG QUERY HKEY_CURRENT_USER\Console /v "FullScreen"') do (
  14. Set ShowMode=%%i
  15. )
  16. Set ShowMode=%ShowMode:~-1%
  17. ::Set display mode to full screen
  18. REG Add HKEY_CURRENT_USER\Console /v FullScreen /t REG_DWORD /d 1 /f>nul
  19. ::Start current Bat script in full screen
  20. start "" %0 %ShowMode%
  21. :End
  22. exit
Slore posted on: 2007-09-23 13:59
Recent Ratings for This Post ( 2 in total) Click for details
RaterScoreTime
dosmania +2 2007-09-23 17:27
HAT +5 2007-09-23 21:39
Floor 14 Posted 2007-09-23 17:27 ·  中国 广东 广州 电信
初级用户
★★
Credits 172
Posts 54
Joined 2007-01-02 10:38
19-year member
UID 75260
Gender Male
Status Offline
The method is wonderful~~~
I always thought that after starting a new window with start, it would wait until the code of the new window is executed before executing exit. Oh, I see``
It turns out that it can be executed synchronously because it runs in different memory spaces, right``
The design of the restore mode is also wonderful, haha
%SystemRoot%_system32_cmd.exe
This entry was automatically created in the registry after I modified the full-screen properties in the CMD window. It turns out that fullscreen in console also works. I accept it marvelously and thank you all for your attention.

In addition, %SystemRoot%_system32_cmd.exe is to modify CMD.exe
Directly modifying the console is to modify that command prompt
Floor 15 Posted 2007-09-23 21:38 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
//But the %0 in the second-to-last statement does not need double quotes. If %0 contains spaces, cmd will automatically preprocess it into a path with double quotes added. Adding double quotes will instead easily cause errors.

Study hard and make progress every day
Forum Jump: