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-22 12:01
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » The syntax and function of STRINGS. Please comment from everyone. Hehe! View 6,821 Replies 15
Original Poster Posted 2004-11-10 00:00 ·  中国 广东 清远 电信
中级用户
★★
Credits 282
Posts 52
Joined 2004-09-29 00:00
21-year member
UID 31947
Gender Male
Status Offline
Last time, with the guidance of Climbing, I finally understood the powerful functions of STRINGS. I don't have an English dictionary at hand, so I can only rely on translation software to finally figure out the usage of some sub - commands of STRINGS. Please see the following introduction specifically. Since I don't understand English, if there are any errors or omissions, please help point them out and supplement them. Thank you!!

STRINGS is a very good batch processing enhancement tool. It has many functions, such as character operations, file operations, memory operations, etc., and can output values to target variables. You can enter STRINGS /? in the DOS prompt to view all its usage parameters.

STRINGS/? (View the list of sub - commands of STRINGS)

The following is the list of sub - commands of STRINGS:

LEFT RIGHT MID LENGTH FIND FINDC
LOWER UPPER CHAR VAL FILEDRIVE FILEDIR
FILENAME FILEEXT PARSE ADDCOMMAS REPEAT READ
WRITE FILESIZE LINESIZE TRUENAME FILEDATE FILETIME
VER ASK INWIN 2FCHECK ENVFREE ENVSIZE
MASTERVAR LOCALVAR TRUEVER FILES LASTDRIVE CODEPAGE
COUNTRY BIOSDATE GETKEY LOCALENV MASTERENV ADD
SUB MUL DIV AND OR XOR
NOT CONVERT PEEK POKE IN OUT
INTERRUPT SCAN DAY MONTH DATE TIME
MEMTOTAL MEMFREE XMSTOTAL XMSFREE XMSVER EMSTOTAL
EMSFREE EMSVER UMBLARGE STRINGSVER INSTALLED HELP

To view the help of a specific command, please enter: STRINGS HELP sub - command
For example: STRINGS HELP LEFT (will display the detailed usage of the LEFT sub - command)

The following are their detailed grammars and functions. The content in 〈〉 is the description of the function.

1. STRINGS LEFT source string number of characters to take 〈Take the specified number of characters from the left of the source string〉
2. STRINGS RIGHT source string number of characters to take 〈Take the specified number of characters from the right of the source string〉
3. STRINGS MID source string start number, end number 〈Take from the middle of the source string〉
4. STRINGS LENGTH source string 〈Return the character length of the source string〉
5. STRINGS FIND source string character 〈Find the specified character from the source character〉
6. STRINGS FINDC source string character 〈Find the specified character from the source character, case - sensitive〉
7. STRINGS LOWER source string 〈Convert the uppercase letters in the source string to lowercase letters〉
8. STRINGS UPPER source string 〈Convert the lowercase letters in the source string to uppercase letters〉
9. STRINGS CHAR character ... 〈Convert characters to ASCII numbers〉
10. STRINGS VAL number ... 〈Convert numbers to ASCII characters〉
11. STRINGS FILEDRIVE file name 〈Return the drive letter where the file name is located〉
12. STRINGS FILEDIR file name 〈Return the directory where the file name is located〉
13. STRINGS FILENAME source file name 〈Return the file name of the source file name, without the extension〉
14. STRINGS FILEEXT source file name 〈Only return the extension of the source file name〉
15. STRINGS ADDCOMMAS number 〈Separate the number with commas every three digits〉
16. STRINGS REPEAT number of repetitions, character or number 〈Repeat the character or number as specified〉
17. STRINGS READ file name, number of lines 〈Read the content of the specified number of lines in the file〉
18. STRINGS WRITE file name, character 〈Append the character to the file〉
19. STRINGS FILESIZE file name 〈Return the size of the file〉
20. STRINGS LINESIZE file name 〈Return the total number of lines of the file content〉
21. STRINGS TRUENAME file name 〈Return the complete path of the file〉
22. STRINGS FILEDATE file name 〈Return the modification date of the file〉
23. STRINGS FILETIME file name 〈Return the modification time of the file〉
24. STRINGS VER 〈Return the DOS version number of the current system〉
25. STRINGS ASK prompt string 〈Dialogue〉
26. STRINGS INWIN 〈Return 1 if running in the DOS window in WINDOWS〉
27. STRINGS ENVFREE 〈Return the free bytes of the environment variable space〉
28. STRINGS ENVSIZE 〈Return the total size of the environment variable space〉
29. STRINGS TRUEVER 〈Return the true version number of the current DOS〉
30. STRINGS FILES 〈Return the number of files accessed simultaneously at present〉
31. STRINGS LASTDRIVE 〈Return the last valid drive letter that the current system can access〉
32. STRINGS CODEPAGE 〈Return the active long file code page of the current system〉
33. STRINGS COUNTRY 〈Return the country code set by the current system〉
34. STRINGS BIOSDATE 〈Return the date of BIOS factory setting〉
35. STRINGS GETKEY 〈Return the ASCII code of the key pressed〉
36. STRINGS ADD number 1, number 2 ... 〈Perform + operation on numbers〉
37. STRINGS SUB number 1, number 2 ... 〈Perform - operation on numbers〉
38. STRINGS MUL number 1, number 2 ... 〈Perform × operation on numbers〉
39. STRINGS DIV number 1, number 2 ... 〈Perform ÷ operation on numbers〉
40. STRINGS AND number 1, number 2 ... 〈Perform "logical AND" operation on numbers〉
41. STRINGS OR number 1, number 2 ... 〈Perform "logical OR" operation on numbers〉
42. STRINGS NOT number 1, number 2 ... 〈Perform "logical NOT" operation on numbers〉
43. STRINGS MEMTOTAL 〈Return the total size of the conventional memory of the system〉
44. STRINGS MEMFREE 〈Return the free size of the conventional memory of the system〉
45. STRINGS XMSTOTAL 〈Return the total size of the extended memory of the system〉
46. STRINGS XMSFREE 〈Return the free size of the extended memory of the system〉
47. STRINGS XMSVER 〈Return the version number of the driver program used by the current extended memory〉
48. STRINGS EMSTOTAL 〈Return the total size of the expanded memory of the system〉
49. STRINGS EMSFREE 〈Return the free size of the expanded memory of the system〉
50. STRINGS EMSVER 〈Return the version number of the driver program used by the current expanded memory〉
51. STRINGS STRINGSVER 〈Return the version number of STRINGS〉

The following are the sub - commands that I haven't understood yet. Please supplement their functions if anyone knows. Thank you!!

PARSE 2FCHECK MASTERVAR LOCALVAR LOCALENV MASTERENV XOR
CONVERT PEEK POKE IN OUT INTERRUPT SCAN
DAY MONTH DATE TIME UMBLARGE INSTALLED

Thank you again, Climbing! Everyone who likes it should give a thumbs up! Hehe!!!
Recent Ratings for This Post ( 3 in total) Click for details
RaterScoreTime
lxmxn +12 2007-06-05 22:54
dslz666 +2 2008-04-29 18:58
Climbing +25 2010-11-10 11:49
Floor 2 Posted 2004-11-11 00:00 ·  中国 山西 运城 联通
银牌会员
★★★
天的白色影子
Credits 2,343
Posts 636
Joined 2004-03-06 00:00
22-year member
UID 19350
Gender Male
Status Offline
Yeah, it's a great thing, but unfortunately it's not very useful. Still, I have to give it a thumbs up!
Floor 3 Posted 2004-11-12 00:00 ·  中国 河北 石家庄 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
That's a good translation. Give it a thumbs up!
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 4 Posted 2006-08-20 15:27 ·  中国 四川 联通
初级用户
Credits 20
Posts 8
Joined 2006-08-14 21:37
19-year member
UID 60527
Status Offline
Correction:
9. STRINGS [target variable=]CHAR number [number1] [number2]... 〈Convert number to ASCII character〉
10. STRINGS [target variable=]VAL character [character1] [character2]... 〈Convert character to ASCII number〉
Floor 5 Posted 2007-02-07 05:37 ·  中国 广东 广州 天河区 电信
中级用户
★★
Credits 210
Posts 85
Joined 2007-01-14 12:38
19-year member
UID 76501
Gender Male
From 广东广州
Status Offline
Bump up! The character processing ability of pure DOS is relatively weak, and STRINGS can be used as a very good enhancement tool.

STRINGS [variable=] PARSE source string, segment number, delimiter
Returns the character segment with the specified number and delimited by the delimiter
For example: STRINGS PARSE 2007-02-06, 2, - returns 02
Floor 6 Posted 2007-03-09 02:55 ·  中国 湖北 黄冈 电信
高级用户
★★★
Credits 894
Posts 411
Joined 2007-02-17 12:15
19-year member
UID 79697
Gender Male
Status Offline
Not quite understand, but since I've read it, I should give it a thumbs up.
@set c= 不知则觉多,知则觉少,越知越多,便觉越来越少. --- 知多少.
@for,/l,%%i,in,(1,1,55)do,@call,set/p=%%c:~%%i,1%%<nul&ping/n 1 127.1>nul


Floor 7 Posted 2007-05-28 16:30 ·  中国 山东 济南 联通
新手上路
Credits 10
Posts 5
Joined 2007-05-28 05:02
19-year member
UID 89525
Gender Male
Status Offline
Thanks to the LZ, looking for the download of STRINGS
Floor 8 Posted 2007-06-05 22:29 ·  中国 广东 东莞 电信
银牌会员
★★★
Credits 1,282
Posts 538
Joined 2002-11-02 00:00
23-year member
UID 129
Gender Male
Status Offline
Can you give an example to illustrate how to use it?
Floor 9 Posted 2007-06-05 22:47 ·  中国 山东 青岛 阿里云
版主
★★★
操作系统爱好者
Credits 1,113
Posts 392
Joined 2002-11-11 00:00
23-year member
UID 228
Gender Male
Status Offline
Support
DOS之家 http://doshome.com 站长 葛明阳
Floor 10 Posted 2007-06-05 22:55 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
That's a good translation. I'll also come to support.
Floor 11 Posted 2007-07-05 21:32 ·  中国 天津 教育网
新手上路
Credits 11
Posts 6
Joined 2006-11-19 23:11
19-year member
UID 71084
Gender Male
Status Offline
Thanks
Floor 12 Posted 2007-07-06 20:53 ·  中国 浙江 嘉兴 海宁市 电信
中级用户
★★
Credits 360
Posts 216
Joined 2007-05-29 17:41
19-year member
UID 89677
Gender Male
Status Offline
Great.

But why can't I use this command in my DOS or CMD? Is my version too low, and which command can I use to check?

Additionally, which are the enhanced commands in CMD, and how to install them?

[ Last edited by bd123456789 on 2007-7-6 at 08:55 PM ]
Floor 13 Posted 2008-01-07 15:15 ·  中国 内蒙古 包头 电信
新手上路
Credits 2
Posts 1
Joined 2007-11-28 10:02
18-year member
UID 104018
Gender Male
Status Offline
Good stuff, the younger brother just happened to use it, thank you
Floor 14 Posted 2008-03-25 12:20 ·  中国 广东 广州 电信
中级用户
★★
Credits 233
Posts 117
Joined 2007-11-28 02:38
18-year member
UID 104005
Gender Male
Status Offline
Thanks, finally found the help file
Floor 15 Posted 2008-05-06 18:22 ·  中国 广东 深圳 联通
初级用户
Credits 80
Posts 36
Joined 2007-06-14 09:41
19-year member
UID 91264
Gender Male
Status Offline
Useful
Top it up
Forum Jump: