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-06-29 15:59
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Original][CMD] View NFO Stuff (2.0 Install-Free Version and Old Version Uninstallation) DigestI View 6,693 Replies 10
Original Poster Posted 2006-07-18 11:38 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline

::ViewNFO2.cmd Version 2.0
::
:: By est, electronicstar@126.com
:: CHiNA DOS UNiON, www.cn-dos.net


@echo off

if == goto RegViewNfo

color f0
chcp 437
cls
title %~n1%~x1 - ViewNfo.cmd by est V2.0
type %1
> nul pause
exit

:RegViewNfo
assoc .nfo=nfofile>nul
ftype nfofile="%~d0%~p0ViewNfo2.cmd" "%%1">nul
echo the .nfo file type was registered successfully.
pause> nul



First, save the code as ViewNfo2.cmd and place it in a program directory, such as: D:\Program Files\ViewNfo\ . Double-click to execute ViewNfo2.cmd, and it will automatically register the association for .nfo files. In the future, when you download Warez stuff and want to view the .nfo, double-clicking it will automatically open it with ViewNFO.bat. If you don't want to associate the .nfo file type, you can drag the .nfo file to ViewNfo2.cmd each time you want to view it.

Old version uninstallation:

more +4 < %~f0 >%temp%\UninstallViewNfo2.reg
regedit -s %temp%\UninstallViewNfo2.reg
exit

Windows Registry Editor Version 5.00




@="MSInfo.Document"



Save the code as UninstallViewNfo2.cmd and double-click to execute it to uninstall the .nfo file association function.

There are many software tools on the Internet for viewing .nfo and ASCII Art, but almost none have handled the Chinese garbled code problem well. However, the cmd has a unique codepage environment, which can easily switch to the pure ASCII environment. So I had the idea of writing this small program. There are still many deficiencies, and I hope everyone can give more suggestions.


This picture is of the old version~ Just to show the display effect~



[ Last edited by willsort on 2006-8-2 at 17:41 ]

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 2 Posted 2006-07-18 14:32 ·  中国 广东 广州 中移铁通
中级用户
★★
Credits 256
Posts 93
Joined 2006-03-26 22:12
20-year member
UID 52853
Gender Male
From 广东
Status Offline

Modify brother's code:
When generating the file, to avoid using echo >>
````````````````````````
@echo off
::ViewNFO.cmd Version 1.3.05 Beta
::
:: By est, electronicstar@126.com
:: CHiNA DOS UNiON, www.cn-dos.net

more +12 < %0 >> ViewNFO.bat
assoc .nfo=nfofile
ftype nfofile="%~d0%~p0ViewNFO.bat" "%%1"
exit

:: Generate new file! ViewNFO.bat
@echo off
color f0
mode con codepage select=437
cls
title %~n1%~x1 - ViewNfo.cmd by est V1.1.05 Beta
type %1
pause > nul




Using type to display .nfo files will drag to the end.

If using more < *.nfo
then it will not drag to the end. However, it is displayed page by page. Currently, the first page is displayed. Press the space bar to display the next page.
Refer to more /?

Here are a few pictures!


[ Last edited by doscc on 2006-7-18 at 14:33 ]
Attachments
1.JPG
2.JPG
3.JPG
4.JPG
Floor 3 Posted 2006-07-18 14:51 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
The usage upstairs is classic! It seems that back then when playing Basic, we also wrote machine code after.bas and directly called it~~~

However, more is not recommended, I find it inconvenient~~

It seems the program can be upgraded to 1.6.00, hehe

If there are experts who can solve the problem of paths containing spaces and write a single bat that doesn't need installation, that would be great

[ Last edited by electronixtar on 2006-7-18 at 15:32 ]

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 4 Posted 2006-07-18 15:34 ·  中国 北京 联通
银牌会员
★★★
DOS联盟捡破烂的
Credits 1,144
Posts 425
Joined 2005-10-20 00:00
20-year member
UID 43784
From 北京
Status Offline
Strong!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Learned another trick............................ I pour....................
Floor 5 Posted 2006-07-18 15:46 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
BagPipe overpraises, compared to your those codes, this thing is really unrefined

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 6 Posted 2006-07-19 13:21 ·  中国 山西 大同 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
Re est:

Also chip in, both the functionality and code have been simplified.

If you want to post an nfo, it's best to post the original instead of a screenshot. This not only allows local restoration but also reduces the attachment size.

After registering the.nfo, you can view it directly by the full name of the.nfo file in cmd. Adding.nfo to pathext allows you to omit the extension when viewing.

Also, if anyone is interested, why not design a cn-dos nfo.


@echo off & chcp 437>nul
for %%f in ("%~dpn1*.nfo") do title %%~nxf & type "%%~f" & pause>nul


[ Last edited by willsort on 2006-7-19 at 13:29 ]
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 7 Posted 2006-07-19 15:02 ·  中国 北京 联通
银牌会员
★★★
DOS联盟捡破烂的
Credits 1,144
Posts 425
Joined 2005-10-20 00:00
20-year member
UID 43784
From 北京
Status Offline
I'll also give you a bit to supplement the concept of CODE PAGE and its setting values

Chcp
Displays the number of the active console code page, or changes the console's active console code page. Used without parameters, chcp displays the number of the active console code page.
Syntax
chcp [nnn]
Parameters
nnn : Specifies the code page. The following table lists each code page supported and its country/region or language:
Code page Country/region or language
437 United States
850 Multilingual (Latin I)
852 Slavic (Latin II)
855 Cyrillic (Russian)
857 Turkish
860 Portuguese
861 Icelandic
863 Canadian-French
865 Nordic
866 Russian
869 Modern Greek
What is code page, and how to modify the codepage in Windows cmd

If your cmd can't display Chinese or other characters normally, modify it through chcp, where the parameter nnn represents three numbers. The codepage for Simplified Chinese is: 936, and for Western is: 1252

History of Code page:



1. Definition and history of Codepage
Character code refers to the internal code used to represent characters. Readers use internal codes when inputting and storing documents. Internal codes are divided into
Single-Byte character sets (SBCS), which can support 256 character encodings.
Double-Byte character sets (DBCS), which can support 65,000 character encodings. Mainly used to encode large character set Oriental texts.
codepage refers to a selected list of character internal codes arranged in a specific order. For early single-byte internal code languages, the internal code order in codepage enables the system to give a corresponding internal code according to the input value of the keyboard according to this list. For double-byte internal codes, it gives a correspondence table from MultiByte to Unicode, so that characters stored in Unicode form can be converted into corresponding character internal codes, or vice versa. The corresponding functions in the Linux kernel are utf8_mbtowc and utf8_wctomb.
Before 1980, there were still no international standards such as ISO-8859 or Unicode to define how to extend US-ASCII encoding for non-English users. Many IT manufacturers invented their own encodings and used hard-to-remember numbers to identify them:



For example, 936 represents Simplified Chinese. 950 represents Traditional Chinese.



1.1 CJK Codepage
Greatly different from Extended Unix Coding (EUC) encoding, all the following Far East codepage use C1 control codes {=80..=9F} as the first byte and ASCII values {=40..=7E} as the second byte to include up to tens of thousands of double-byte characters, which indicates that ASCII values less than 3F in this encoding do not necessarily represent ASCII characters.

CP932

Shift-JIS contains Japanese charset JIS X 0201 (one byte per character) and JIS X 0208 (two bytes per character), so JIS X 0201 hiragana contains one byte half-width characters, and the remaining 60 bytes are used as the first byte for 7,076 Chinese characters and 648 other full-width characters. Different from EUC-JP encoding, Shift-JIS does not contain 5,802 Chinese characters defined in JIS X 202.

CP936

GBK extends EUC-CN encoding (GB 2312-80 encoding, including 6,763 Chinese characters) to 20,902 Chinese characters defined in Unicode (GB13000.1-93), and Simplified Chinese zh_CN is used in mainland China.

CP949

UnifiedHangul (UHC) is a superset of Korean EUC-KR encoding (KS C 5601-1992 encoding, including 2,350 Korean syllables and 4,888 Chinese characters a), and contains 8,822 additional Korean syllables (in C1)

CP950

is the Big5 encoding (13,072 Traditional Chinese zh_TW Chinese characters) replacing EUC-TW (CNS 11643-1992), and these definitions can be found in Ken Lunde's CJK.INF or the Unicode encoding table.

Note: Microsoft adopts the above four Codepage, so the above Codepage must be used when accessing the Microsoft file system.


1.2 IBM's Far East language Codepage
IBM's Codepage is divided into SBCS and DBCS:

IBM SBCS Codepage


37 (English) *
290 (Japanese) *
833 (Korean) *
836 (Simplified Chinese) *
891 (Korean)
897 (Japanese)
903 (Simplified Chinese)
904 (Traditional Chinese)
IBM DBCS Codepage

300 (Japanese) *
301 (Japanese)
834 (Korean) *
835 (Traditional Chinese) *
837 (Simplified Chinese) *
926 (Korean)
927 (Traditional Chinese)
928 (Simplified Chinese)
Mixing SBCS Codepage and DBCS Codepage becomes: IBM MBCS Codepage

930 (Japanese) (Codepage 300 plus 290) *
932 (Japanese) (Codepage 301 plus 897)
933 (Korean) (Codepage 834 plus 833) *
934 (Korean) (Codepage 926 plus 891)
938 (Traditional Chinese) (Codepage 927 plus 904)
936 (Simplified Chinese) (Codepage 928 plus 903)
5031 (Simplified Chinese) (Codepage 837 plus 836) *
5033 (Traditional Chinese) (Codepage 835 plus 37) *
* means using EBCDIC encoding format

It can be seen that Microsoft's CJK Codepage is derived from IBM's Codepage
Floor 8 Posted 2006-08-02 14:12 ·  中国 广西 南宁 电信
新手上路
Credits 8
Posts 4
Joined 2006-08-02 13:46
19-year member
UID 59677
Gender Male
Status Offline
Learning... Thank you
Floor 9 Posted 2008-01-06 14:49 ·  中国 湖南 湘潭 电信
初级用户
火焙鱼
Credits 35
Posts 14
Joined 2007-05-24 00:22
19-year member
UID 89115
Gender Male
From 湖南省湘潭市
Status Offline
Just came here to stroll around, found the owner's good stuff, thank you very much!
Floor 10 Posted 2008-01-28 14:03 ·  中国 广东 深圳 电信
新手上路
Credits 16
Posts 8
Joined 2008-01-28 02:04
18-year member
UID 109687
Gender Male
Status Offline
Good
Floor 11 Posted 2008-05-08 00:11 ·  中国 江西 上饶 广信区 电信
初级用户
Credits 29
Posts 29
Joined 2008-05-07 22:34
18-year member
UID 118049
Gender Male
Status Offline
Hey, a country bumpkin coming to the city, seeing something good and hiding it. Wait, when I also have culture someday, I'll come up here and write something for you guys. I just don't know if anyone will cheer me on then.
Forum Jump: