|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『楼 主』:
[原创][CMD]看NFO的东东(2.0免安装版本及旧版本卸载)
使用 LLM 解释/回答一下
::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
先把代码存成ViewNfo2.cmd,放到一个装程序的目录下,如:D:\Program Files\ViewNfo\,双击执行ViewNfo2.cmd就会自动注册 .nfo 文件的关联。以后下载了Warez的东东看 .nfo 的时候双击就会自动用 ViewNFO.bat打开。如果你不想关联.nfo文件类型,每次看.nfo的时候把.nfo文件拖到ViewNfo2.cmd上就可以了
旧版本卸载:
more +4 < %~f0 >%temp%\UninstallViewNfo2.reg
regedit -s %temp%\UninstallViewNfo2.reg
exit
Windows Registry Editor Version 5.00
@="MSInfo.Document"
把代码存成UninstallViewNfo2.cmd,双击执行即可以卸载掉.nfo文件关联功能~
网上有很多查看 .nfo 和 ASCII Art 的软件,但是几乎都没有处理好中文乱码的问题。但是cmd下有得天独厚的 codepage环境,可以方便地切换到纯ASCII环境。所以我有了写这个小程序的想法。还有很多不足,希望大家多多提建议。
这张图是旧版本的哈~~只是展示一下显示效果~~
Last edited by willsort on 2006-8-2 at 17:41 ]
::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'>" |
|
2006-7-18 11:38 |
|
|
doscc
中级用户
  
积分 256
发帖 93
注册 2006-3-26 来自 广东
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
改一下兄的代码:
生成文件时 免得用 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
:: 生成新文件! 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
用 type 显示 .nfo 文件 会拖到最后面.
如果用 more < *.nfo
则不会拖到最后面. 不过 是一页一页显示的. 当前是显示第一页. 按 空格键显示下一页.
参考 more /?
下面来几张图!
Last edited by doscc on 2006-7-18 at 14:33 ]
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 ]
附件
1: 1.JPG (2006-7-18 14:32, 67.13 KiB, 下载附件所需积分 1 点
,下载次数: 10)
附件
2: 2.JPG (2006-7-18 14:32, 36.02 KiB, 下载附件所需积分 1 点
,下载次数: 6)
附件
3: 3.JPG (2006-7-18 14:33, 46.35 KiB, 下载附件所需积分 1 点
,下载次数: 6)
附件
4: 4.JPG (2006-7-18 14:33, 52.08 KiB, 下载附件所需积分 1 点
,下载次数: 6)
|
|
2006-7-18 14:32 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
楼上的用法经典!貌似当年玩basic也是在.bas后写机器码直接call~~~
8过不推荐用more,觉得不方便~~
貌似程序可以升级到 1.6.00了,呵呵
如果有高手能解决路径含空格的问题,写出只有一个bat,不用安装的bat就好了
Last edited by electronixtar on 2006-7-18 at 15:32 ]
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'>" |
|
2006-7-18 14:51 |
|
|
bagpipe
银牌会员
     DOS联盟捡破烂的
积分 1144
发帖 425
注册 2005-10-20 来自 北京
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
强!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!又学到一招............................ 我灌....................
Strong!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Learned another trick............................ I pour....................
|
|
2006-7-18 15:34 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
BagPipe过奖了,比其你的那些代码这个东东很没文化了
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'>" |
|
2006-7-18 15:46 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
Re est:
也凑个份子吧,功能和代码都作了简化。
如果要贴nfo的话,最好能贴原件,而不是截图,这样不仅可以在本地还原,也可以减小附件体积。
将.nfo注册后,可以在cmd中以nfo文件全名直接查看,将.nfo加入到pathext,可以直接省略扩展名查看。
另外,谁有兴趣,不妨设计一个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 ]
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:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2006-7-19 13:21 |
|
|
bagpipe
银牌会员
     DOS联盟捡破烂的
积分 1144
发帖 425
注册 2005-10-20 来自 北京
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
我也给你们来一下子,补充说明一下 CODE PAGE的概念及其设置值
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
什么是code page, 怎么修改windows cmd中的codepage
如果你的cmd无法正常显示中文, 或者其他字符, 通过chcp 来修改, 参数是nnn代表3个数字. 简体中文的codepage是: 936 西文是:1252
Code page 的历史:
1. Codepage的定义和历史
字符内码(charcter code)指的是用来代表字符的内码.读者在输入和存储文档时都要使用内码,内码分为
单字节内码 -- Single-Byte character sets (SBCS),可以支持256个字符编码.
双字节内码 -- Double-Byte character sets)(DBCS),可以支持65000个字符编码.主要用来对大字符集的东方文字进行编码.
codepage 指的是一个经过挑选的以特定顺序排列的字符内码列表,对于早期的单字节内码的语种,codepage中的内码顺序使得系统可以按照此列表来根据键盘的输入值给出一个对应的内码.对于双字节内码,则给出的是MultiByte到Unicode的对应表,这样就可以把以Unicode形式存放的字符转化为相应的字符内码,或者反之,在Linux核心中对应的函数就是utf8_mbtowc和utf8_wctomb.
在1980年前,仍然没有任何国际标准如ISO-8859或Unicode来定义如何扩展US-ASCII编码以便非英语国家的用户使用.很多IT厂商发明了他们自己的编码,并且使用了难以记忆的数目来标识:
例如936代表简体中文. 950代表繁体中文.
1.1 CJK Codepage
同 Extended Unix Coding ( EUC )编码大不一样的是,下面所有的远东 codepage 都利用了C1控制码 { =80..=9F } 做为首字节, 使用ASCII值 { =40..=7E { 做为第二字节,这样才能包含多达数万个双字节字符,这表明在这种编码之中小于3F的ASCII值不一定代表ASCII字符.
CP932
Shift-JIS包含日本语 charset JIS X 0201 (每个字符一个字节) 和 JIS X 0208 (每个字符两个字节),所以 JIS X 0201平假名包含一个字节半宽的字符,其剩馀的60个字节被用做7076个汉字以及648个其他全宽字符的首字节.同EUC-JP编码区别的是, Shift-JIS没有包含JIS X 202中定义的5802个汉字.
CP936
GBK 扩展了 EUC-CN 编码( GB 2312-80编码,包含 6763 个汉字)到Unicode (GB13000.1-93)中定义的20902个汉字,中国大陆使用的是简体中文zh_CN.
CP949
UnifiedHangul (UHC) 是韩文 EUC-KR 编码(KS C 5601-1992 编码,包括2350 韩文音节和 4888 个汉字a)的超集,包含 8822个附加的韩文音节( 在C1中 )
CP950
是代替EUC-TW (CNS 11643-1992)的 Big5 编码(13072 繁体 zh_TW 中文字) 繁体中文,这些定义都在Ken Lunde的 CJK.INF中或者 Unicode 编码表中找到.
注意: Microsoft采用以上四种Codepage,因此要访问Microsoft的文件系统时必需采用上面的Codepage .
1.2 IBM的远东语言Codepage
IBM的Codepage分为SBCS和DBCS两种:
IBM SBCS Codepage
37 (英文) *
290 (日文) *
833 (韩文) *
836 (简体中文) *
891 (韩文)
897 (日文)
903 (简体中文)
904 (繁体中文)
IBM DBCS Codepage
300 (日文) *
301 (日文)
834 (韩文) *
835 (繁体中文) *
837 (简体中文) *
926 (韩文)
927 (繁体中文)
928 (简体中文)
将SBCS的Codepage和DBCS的Codepage混合起来就成为: IBM MBCS Codepage
930 (日文) (Codepage 300 加 290) *
932 (日文) (Codepage 301 加 897)
933 (韩文) (Codepage 834 加 833) *
934 (韩文) (Codepage 926 加 891)
938 (繁体中文) (Codepage 927 加 904)
936 (简体中文) (Codepage 928 加 903)
5031 (简体中文) (Codepage 837 加 836) *
5033 (繁体中文) (Codepage 835 加 37) *
*代表采用EBCDIC编码格式
由此可见,Mircosoft的CJK Codepage来源于IBM的Codepage
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
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
|
|
2006-7-19 15:02 |
|
|
chenwei450
新手上路

积分 8
发帖 4
注册 2006-8-2
状态 离线
|
|
2006-8-2 14:12 |
|
|
dengke227
初级用户
  火焙鱼
积分 35
发帖 14
注册 2007-5-24 来自 湖南省湘潭市
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
刚来这里转悠,发现楼主的好东西,非常感谢!
Just came here to stroll around, found the owner's good stuff, thank you very much!
|
|
2008-1-6 14:49 |
|
|
zhangzhaoc
新手上路

积分 16
发帖 8
注册 2008-1-28
状态 离线
|
|
2008-1-28 14:03 |
|
|
zljzsm
初级用户
 
积分 29
发帖 29
注册 2008-5-7
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
哎 乡下人进城 看到好东西就藏
等什么时候俺也有了文化
俺也上来给你们写点什么
就不知道到时候有没有人给俺捧场
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.
|
|
2008-5-8 00:11 |
|
|