|
ww111222
中级用户
  
积分 354
发帖 83
注册 2003-3-23
状态 离线
|
『楼 主』:
我搜索过,但没有找到答案,如何在DOS下判断哪个数字大
使用 LLM 解释/回答一下
我是在 DOS 7.1 的环境下
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::名称:size_for.bat
::用法:call size_for.bat %1
::参数:%1 为分区的大小
::功能:对硬盘的分区进行判断,如果大于4500,则输出"/NTFS"
:: 小于4500,则输出"/-32"
::By:笑晨公子
::QQ:24070970
::网址:http://www.Y8Y8.com
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set size=%1
set form=
if %size% GTR 4500 set form="/NTFS"
echo form = %form%
我在执行的时候 提示:syntax error
哪位高人帮我指点一下?
谢谢
Last edited by ww111222 on 2007-8-19 at 12:10 PM ]
I am under the environment of DOS 7.1
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::Name: size_for.bat
::Usage: call size_for.bat %1
::Parameter: %1 is the size of the partition
::Function: Judge the partition of the hard disk. If it is greater than 4500, output "/NTFS"; if less than 4500, output "/-32"
::By: Xiao Chen Gongzi
::QQ: 24070970
::Website: http://www.Y8Y8.com
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set size=%1
set form=
if %size% GTR 4500 set form="/NTFS"
echo form = %form%
When I execute it, it prompts: syntax error
Which expert can help me give some pointers?
Thank you
Last edited by ww111222 on 2007-8-19 at 12:10 PM ]
|
|
2007-8-19 00:54 |
|
|
knoppix7
银牌会员
    
积分 1287
发帖 634
注册 2007-5-2 来自 cmd.exe
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
你自己看看command里的if /?核cmd里的if /?差多少
You just look at how much the difference is between if /? in command and if /? in cmd
|
|
2007-8-19 11:22 |
|
|
ww111222
中级用户
  
积分 354
发帖 83
注册 2003-3-23
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
我是在 DOS 7.1 下面,实在搞不定了
I'm under DOS 7.1, really can't figure it out
|
|
2007-8-19 12:09 |
|
|
knoppix7
银牌会员
    
积分 1287
发帖 634
注册 2007-5-2 来自 cmd.exe
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
因为DOS根本没有比较的命令.
Because DOS has no comparison command at all.
|
|
2007-8-19 12:11 |
|
|
ww111222
中级用户
  
积分 354
发帖 83
注册 2003-3-23
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
Originally posted by knoppix7 at 2007-8-19 12:11 PM:
因为DOS根本没有比较的命令.
谢谢你了, 看来要有点难度了
搞不定,我不吃饭
Originally posted by knoppix7 at 2007-8-19 12:11 PM:
Because DOS has no comparison command at all.
Thank you. It seems a bit difficult.
Can't handle it, I won't eat.
|
|
2007-8-19 19:17 |
|
|
knoppix7
银牌会员
    
积分 1287
发帖 634
注册 2007-5-2 来自 cmd.exe
状态 离线
|
|
2007-8-19 19:56 |
|
|
ww111222
中级用户
  
积分 354
发帖 83
注册 2003-3-23
状态 离线
|
『第 7 楼』:
在纯DOS7.1下批处理如何判断两个数字的大小?
使用 LLM 解释/回答一下
已经查了 好多天的资料了,但一起找不到 答案
环境是:MSDOS7.1 的环境,
I've been looking up information for many days, but I still can't find the answer.
The environment is: MSDOS7.1 environment,
|
|
2007-8-20 22:47 |
|
|
zhangxue
初级用户
 
积分 183
发帖 82
注册 2006-3-28
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
strings.com程序,例如判断变量%a%,%b%的大小:strings xx=sub %a%,%b%,通过errorlevel判断.
The program of strings.com, for example, to judge the size of variables %a% and %b%: strings xx=sub %a%,%b%, and judge through errorlevel
|
|
2007-8-20 23:40 |
|
|
ww111222
中级用户
  
积分 354
发帖 83
注册 2003-3-23
状态 离线
|
|
2007-8-21 00:20 |
|
|
ww111222
中级用户
  
积分 354
发帖 83
注册 2003-3-23
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
Originally posted by zhangxue at 2007-8-20 11:40 PM:
strings.com程序,例如判断变量%a%,%b%的大小:strings xx=sub %a%,%b%,通过errorlevel判断.
你好, 能给个 提示吗?
Originally posted by zhangxue at 2007-8-20 11:40 PM:
For the strings.com program, for example, to determine the size of variables %a% and %b%: strings xx=sub %a%,%b%, and determine through errorlevel.
Hello, can you give a hint?
|
|
2007-8-21 17:09 |
|
|
zhangxue
初级用户
 
积分 183
发帖 82
注册 2006-3-28
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
strings m=sub %a%,%b%
if errorlevel 1 echo %a% 小于 %b%
#它的规则是这样的,如果前一个数比后一个数大,就将相减的结果赋给变量m
#如果前面的数小于后面的数,就会返回errorlevel 1
strings m=sub %a%,%b%
if errorlevel 1 echo %a% is less than %b%
#The rule is like this: if the previous number is greater than the next number, the result of subtraction is assigned to variable m
#If the previous number is less than the next number, it will return errorlevel 1
|
|
2007-8-21 18:21 |
|
|
zhangxue
初级用户
 
积分 183
发帖 82
注册 2006-3-28
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
1.STRINGS [目标变量=]LEFT 源字符串 要取的字符数量 〈从左边取源字符串的指定字符数量〉
2.STRINGS [目标变量=]RIGHT 源字符串 要取的字符数量 〈从右边取源字符串的指定字符数量〉
3.STRINGS [目标变量=]MID 源字符串 起止数,终止数 〈从中央取源字符串〉
4.STRINGS [目标变量=]LENGTH 源字符串 〈返回源字符串的字符长度〉 5.STRINGS [目标变量=]FIND 源字符串 字符 〈从源字符中查找指定的字符〉
6.STRINGS [目标变量=]FINDC 源字符串 字符 〈从源字符中查找指定的字符,区分大小写〉
7.STRINGS [目标变量=]LOWER 源字符串 〈将源字符串中的大写字母转换成小写字母〉
8.STRINGS [目标变量=]UPPER 源字符串 〈将源字符串中的小写字母转换成大写字母〉
9.STRINGS [目标变量=]CHAR 字符 [字符1] [字符2]... 〈将字符转换成ASCII数字〉
10、STRINGS [目标变量=]VAL 数字 [数字1] [数字2]... 〈将数字转换成ASCII字符〉
11、STRINGS [目标变量=]FILEDRIVE 文件名 〈返回文件名所在的盘符〉
12、STRINGS [目标变量=]FILEDIR 文件名 〈返回文件名所在的目录〉
13、STRINGS [目标变量=]FILENAME 源文件名 〈返回源文件名的文件名,不要扩展名〉
14、STRINGS [目标变量=]FILEEXT 源文件名 〈只返回源文件名的扩展名〉
15、STRINGS [目标变量=]ADDCOMMAS 数字 〈将数字每隔三位用逗号隔开〉
16、STRINGS [目标变量=]REPEAT 重复多少,字符或数字 〈将字符或数字进行指定的重复〉
17、STRINGS [目标变量=]READ 文件名,行数 〈读取文件中指定行数的内容〉
18、STRINGS [目标变量=]WRITE 文件名,字符 〈将字符追加到文件中〉
19、STRINGS [目标变量=]FILESIZE 文件名 〈返回文件的大小〉
20、STRINGS [目标变量=]LINESIZE 文件名 〈返回文件内容的总行数〉
21、STRINGS [目标变量=]TRUENAME 文件名 〈返回文件的完整路径〉
22、STRINGS [目标变量=]FILEDATE 文件名 〈返回文件的修改日期〉
23、STRINGS [目标变量=]FILETIME 文件名 〈返回文件的修改时间〉
24、STRINGS [目标变量=]VER 〈返回当前系统的DOS版本号〉
25、STRINGS [目标变量=]ASK 提未字符串[,最大输入数][,1=*显示 2=不显示] 〈对话〉
26、STRINGS [目标变量=]INWIN 〈如果在WINDOWS中的DOS窗口中运行则返回1〉
27、STRINGS [目标变量=]ENVFREE 〈返回环境变量空间的空闲字节数〉
28、STRINGS [目标变量=]ENVSIZE 〈返回环境变量空间的总共大小〉
29、STRINGS [目标变量=]TRUEVER 〈返回当前DOS的真实版本号〉
30、STRINGS [目标变量=]FILES 〈返回当前同时访问的文件数量〉
31、STRINGS [目标变量=]LASTDRIVE 〈返回当前系统可以访问最后有效的驱动器字母〉
32、STRINGS [目标变量=]CODEPAGE 〈返回当前系统活动的长文件代码页〉
33、STRINGS [目标变量=]COUNTRY 〈返回当前系统设置的国家代码〉
34、STRINGS [目标变量=]BIOSDATE 〈返回BIOS出厂的日期〉
35、STRINGS [目标变量=]GETKEY 〈返回按键的ASCII代码〉
36、STRINGS [目标变量=]ADD 数字1,数字2[,数字3]... 〈对数字进行+运算〉
37、STRINGS [目标变量=]SUB 数字1,数字2[,数字3]... 〈对数字进行-运算〉
38、STRINGS [目标变量=]MUL 数字1,数字2[,数字3]... 〈对数字进行×运算〉
39、STRINGS [目标变量=]DIV 数字1,数字2[,数字3]... 〈对数字进行÷运算〉
40、STRINGS [目标变量=]AND 数字1,数字2[,数字3]... 〈对数字进行“逻辑与”运算〉
41、STRINGS [目标变量=]OR 数字1,数字2[,数字3]... 〈对数字进行“逻辑或”运算〉
42、STRINGS [目标变量=]NOT 数字1,数字2[,数字3]... 〈对数字进行“逻辑取反”运算〉
43、STRINGS [目标变量=]MEMTOTAL 〈返回系统总共的常规内存大小〉
44、STRINGS [目标变量=]MEMFREE 〈返回系统空闲的常规内存大小〉
45、STRINGS [目标变量=]XMSTOTAL 〈返回系统总共的扩展内存大小〉
46、STRINGS [目标变量=]XMSFREE 〈返回系统空闲的扩民内存大小〉
47、STRINGS [目标变量=]XMSVER 〈返回当前扩展内存使用的驱动程序的版本号〉
48、STRINGS [目标变量=]EMSTOTAL 〈返回系统总共的扩充内存大小〉
49、STRINGS [目标变量=]EMSFREE 〈返回系统空闲的扩充内存大小〉
50、STRINGS [目标变量=]EMSVER 〈返回当前扩充内存使用的驱动程序的版本号〉
51、STRINGS [目标变量=]STRINGSVER 〈返回STRINGS的版本号〉
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 center 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 string〉
6. STRINGS FINDC Source string Character 〈Find the specified character from the source string, case-sensitive〉
7. STRINGS LOWER Source string 〈Convert uppercase letters in the source string to lowercase letters〉
8. STRINGS UPPER Source string 〈Convert 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 〈Return only 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, Line number 〈Read the content of the specified line 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 in the file content〉
21. STRINGS TRUENAME File name 〈Return the full 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 current system's DOS version number〉
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 currently accessed simultaneously〉
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〉
35. STRINGS GETKEY 〈Return the ASCII code of the key pressed〉
36. STRINGS ADD Number1, Number2 ... 〈Perform + operation on numbers〉
37. STRINGS SUB Number1, Number2 ... 〈Perform - operation on numbers〉
38. STRINGS MUL Number1, Number2 ... 〈Perform × operation on numbers〉
39. STRINGS DIV Number1, Number2 ... 〈Perform ÷ operation on numbers〉
40. STRINGS AND Number1, Number2 ... 〈Perform "logical AND" operation on numbers〉
41. STRINGS OR Number1, Number2 ... 〈Perform "logical OR" operation on numbers〉
42. STRINGS NOT Number1, Number2 ... 〈Perform "logical NOT" operation on numbers〉
43. STRINGS MEMTOTAL 〈Return the total amount of conventional memory in the system〉
44. STRINGS MEMFREE 〈Return the free amount of conventional memory in the system〉
45. STRINGS XMSTOTAL 〈Return the total amount of extended memory in the system〉
46. STRINGS XMSFREE 〈Return the free amount of extended memory in the system〉
47. STRINGS XMSVER 〈Return the version number of the driver program currently using extended memory〉
48. STRINGS EMSTOTAL 〈Return the total amount of expanded memory in the system〉
49. STRINGS EMSFREE 〈Return the free amount of expanded memory in the system〉
50. STRINGS EMSVER 〈Return the version number of the driver program currently using expanded memory〉
51. STRINGS STRINGSVER 〈Return the version number of STRINGS〉
|
|
2007-8-21 18:22 |
|
|
ww111222
中级用户
  
积分 354
发帖 83
注册 2003-3-23
状态 离线
|
|
2007-8-21 18:46 |
|
|
zhangxue
初级用户
 
积分 183
发帖 82
注册 2006-3-28
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
set form=/-32
strings mm=sub %1,4500>nul
if not errorlevel 1 set form=/NTFS
set form=/-32
strings mm=sub %1,4500>nul
if not errorlevel 1 set form=/NTFS
附件
1: STRINGS.rar (2007-8-21 21:11, 8.55 KiB,下载次数: 106)
|
|
2007-8-21 21:09 |
|
|
ww111222
中级用户
  
积分 354
发帖 83
注册 2003-3-23
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
Originally posted by zhangxue at 2007-8-21 09:09 PM:
set form=/-32
strings mm=sub %1,4500>nul
if not errorlevel 1 set form=/NTFS
谢谢, 看到 这位兄台 在我发的 论坛(包括别的论坛)上的 这个帖子 都回复了,
我很感动,
无以为报, 来新疆 。塔城,我请客
Originally posted by zhangxue at 2007-8-21 09:09 PM:
set form=/-32
strings mm=sub %1,4500>nul
if not errorlevel 1 set form=/NTFS
Thank you. I saw that this brother has replied to this post of mine on the forum (including other forums),
I am very moved,
No way to repay, come to Xinjiang. Tacheng, I treat you to a meal
|
|
2007-8-21 21:54 |
|