|
peiliqin
初级用户
 
积分 34
发帖 16
注册 2008-7-24
状态 离线
|
『楼 主』:
[求助][讨论]有没有高手可以在纯dos下做到这个功能?
使用 LLM 解释/回答一下
有没有高手可以在纯dos下做到这个功能?
SMARTDRV.EXE
if exist a:\jieguo.txt del a:\jieguo.txt
md5 -c n:\tools\cfcsys.txt >a:\jieguo.txt
for /f "tokens=2" %%W in (d:\fix\cfcsys.txt) do if /i "%%W" NEQ "OK" goto end
pause
exit
:end
command.com /c n:\gamemenu\system\fix.bat >nul
pause
n:\tools\cfcsys.txt 文件实际存在。
不管用什么方法,什么软件,谁能实现这个要求?向高手求救了。!!!!!!
补充:cfcsys.txt的内容(只是范例)
\89fe32de8587b0dfd76efce00396eb56 *c:\\windows\\NOTEPAD.EXE
\82b8373ed12a602820108f6154bf0c4c *c:\\windows\\explorer.exe
\b313c22a27d1d8677cdec778346d817e *c:\\windows\\regedit.exe
\65a70ec4649499399b50ac75d911a501 *c:\\windows\\system32\\Rundll32.exe
\9cabf264ce1177cafbbba4b910a44c79 *c:\\windows\\system32\\Services.exe
\06955b9a1ce9f54be0193030ef0a6e0e *c:\\windows\\system32\\Winlogon.exe
\722a247acb86960a708528120759266d *c:\\windows\\system32\\cmd.exe
\3502114e4cb83e491a80fc361c1dc7b7 *c:\\windows\\system32\\csrss.exe
jieguo.txt的内容
c:\windows\NOTEPAD.EXE: OK
c:\windows\explorer.exe: OK
c:\windows\regedit.exe: OK
c:\windows\system32\Rundll32.exe: OK
c:\windows\system32\Services.exe: OK
c:\windows\system32\Winlogon.exe: OK
c:\windows\system32\cmd.exe: OK
c:\windows\system32\csrss.exe: OK
Last edited by peiliqin on 2008-7-29 at 12:12 AM ]
Is there any expert who can achieve this function under pure DOS?
SMARTDRV.EXE
if exist a:\jieguo.txt del a:\jieguo.txt
md5 -c n:\tools\cfcsys.txt >a:\jieguo.txt
for /f "tokens=2" %%W in (d:\fix\cfcsys.txt) do if /i "%%W" NEQ "OK" goto end
pause
exit
:end
command.com /c n:\gamemenu\system\fix.bat >nul
pause
The file n:\tools\cfcsys.txt actually exists.
No matter what method or software is used, who can fulfill this requirement? I'm seeking help from experts!!!!!
Supplement: The content of cfcsys.txt (just an example)
\89fe32de8587b0dfd76efce00396eb56 *c:\\windows\\NOTEPAD.EXE
\82b8373ed12a602820108f6154bf0c4c *c:\\windows\\explorer.exe
\b313c22a27d1d8677cdec778346d817e *c:\\windows\\regedit.exe
\65a70ec4649499399b50ac75d911a501 *c:\\windows\\system32\\Rundll32.exe
\9cabf264ce1177cafbbba4b910a44c79 *c:\\windows\\system32\\Services.exe
\06955b9a1ce9f54be0193030ef0a6e0e *c:\\windows\\system32\\Winlogon.exe
\722a247acb86960a708528120759266d *c:\\windows\\system32\\cmd.exe
\3502114e4cb83e491a80fc361c1dc7b7 *c:\\windows\\system32\\csrss.exe
The content of jieguo.txt
c:\windows\NOTEPAD.EXE: OK
c:\windows\explorer.exe: OK
c:\windows\regedit.exe: OK
c:\windows\system32\Rundll32.exe: OK
c:\windows\system32\Services.exe: OK
c:\windows\system32\Winlogon.exe: OK
c:\windows\system32\cmd.exe: OK
c:\windows\system32\csrss.exe: OK
Last edited by peiliqin on 2008-7-29 at 12:12 AM ]
|
|
2008-7-27 02:31 |
|
|
peiliqin
初级用户
 
积分 34
发帖 16
注册 2008-7-24
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
用其他的方法,变通一下,或者有没有其他的dos软件可以做到?
Use other methods, be flexible, or are there other DOS software that can do it?
|
|
2008-7-27 21:24 |
|
|
peiliqin
初级用户
 
积分 34
发帖 16
注册 2008-7-24
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
用其他的方法,变通一下,或者有没有其他的dos软件可以做到? 怎么没有人回答啊?
Use other methods, be flexible, or are there other DOS software that can do it? Why is there no one answering?
|
|
2008-7-28 00:33 |
|
|
peiliqin
初级用户
 
积分 34
发帖 16
注册 2008-7-24
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
听说,dos下有个awk可以做到,可是看不懂,搞的一头雾水。请教awk高手帮帮忙了啊。
I heard that there is an awk under DOS that can do it, but I can't understand it and am completely confused. Please help out, O great awk experts.
|
|
2008-7-28 00:38 |
|
|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
|
2008-7-28 00:41 |
|
|
quya
高级用户
    五星老土
积分 558
发帖 172
注册 2003-2-9 来自 江苏
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
看他的程序,可以猜到 CFCSYS.txt 的内容是 MD5 码 校验的结果, 只要有一个文件不通过, 就运行 FIX.BAT, FIX.BAT想必就是对没通过校验的文件进行修复之类的工作。
怎么做,我不知道,等其他人吧。
DOS因为有了FOR才变得丰富多彩,纯DOS下就那么几个命令,无法取巧,除非用第三方程序。
Looking at his program, it can be guessed that the content of CFCSYS.txt is the result of MD5 check. As long as one file fails, it will run FIX.BAT. Presumably, FIX.BAT is for repairing files that failed the check and so on.
How to do it, I don't know, wait for others.
DOS has become colorful because of FOR. There are only a few commands in pure DOS, and there's no way to take shortcuts, unless using third-party programs.
|

我怎么找不到一个比我注册日期早的人? 难道我是传说中的超级管理员? 其实我只是个潜水冠军而已. |
|
2008-7-28 19:53 |
|
|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
|
2008-7-28 21:17 |
|
|
peiliqin
初级用户
 
积分 34
发帖 16
注册 2008-7-24
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
Originally posted by quya at 2008-7-28 07:53 PM:
看他的程序,可以猜到 CFCSYS.txt 的内容是 MD5 码 校验的结果, 只要有一个文件不通过, 就运行 FIX.BAT, FIX.BAT想必就是对没通过校验的文件进行修复之 ...
cfcsys.txt是标准文件,jieguo.txt是个根据cfcsys.txt生成的临时文件。
Originally posted by quya at 2008-7-28 07:53 PM:
Looking at his program, it can be guessed that the content of CFCSYS.txt is the result of MD5 check. As long as one file fails, it will run FIX.BAT, and FIX.BAT is presumably to repair the files that failed the check...
cfcsys.txt is a standard file, and jieguo.txt is a temporary file generated according to CFCSYS.txt.
|
|
2008-7-29 00:15 |
|
|
lianjiang2004
金牌会员
     
积分 3946
发帖 1884
注册 2006-1-20
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
可用截取每行最后两位字符,若不等于OK,就修复的方法。
strings就可以。
You can use the method of intercepting the last two characters of each line. If it is not equal to OK, then repair it. strings can be used.
|

Windows 一键还原
http://www.yjhy.com |
|
2008-7-29 07:45 |
|
|
peiliqin
初级用户
 
积分 34
发帖 16
注册 2008-7-24
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
Originally posted by DOSforever at 2008-7-28 12:41 AM:
我不知道 d:\fix\cfcsys.txt 文件具体的内容是什么,按照你原来的意思,只要有一行中的第二个字不是 "OK" 的话就 goto end ,也就是每一行都要有 & ...
试了一下,当文件内容有改变的时候,总是不能确定errorlevel的值。无法进行跳转。
Originally posted by DOSforever at 2008-7-28 12:41 AM:
I don't know what the specific content of the file d:\fix\cfcsys.txt is. According to your original meaning, as long as the second word in a line is not "OK", then goto end, that is, each line should have &...
Tried it, but when the content of the file changes, it's always impossible to determine the value of errorlevel. Can't perform the jump.
|
|
2008-7-29 07:59 |
|
|
peiliqin
初级用户
 
积分 34
发帖 16
注册 2008-7-24
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
Originally posted by lianjiang2004 at 2008-7-29 07:45 AM:
可用截取每行最后两位字符,若不等于OK,就修复的方法。
strings就可以。
我也看这个参数了,就是不知道怎么取 strings的值。能不能给个确切的例子?
Originally posted by lianjiang2004 at 2008-7-29 07:45 AM:
You can use the method of intercepting the last two characters of each line. If it is not equal to OK, then repair it. The strings command can do it.
I also looked at this parameter, but I don't know how to get the value of strings. Can you give an exact example?
|
|
2008-7-29 08:01 |
|
|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
|
2008-7-29 09:56 |
|
|
qzwqzw
银牌会员
     天的白色影子
积分 2343
发帖 636
注册 2004-3-6
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
使用 command /c 是想屏掉 fix.bat 的输出
但是仍然不明白 d:\fix\cfcsys.txt 与 n:\tools\cfcsys.txt 是什么关系
按照12楼的思路给个最简化的原型代码
可以参考一下
find /v /i "OK" <d:\fix\cfcsys.txt>nul
if errorlevel 1 exit
command.com /c n:\gamemenu\system\fix.bat >nul
Using command /c is to suppress the output of fix.bat
But still don't understand the relationship between d:\fix\cfcsys.txt and n:\tools\cfcsys.txt
Give a most simplified prototype code according to the idea of building 12
Can refer to
find /v /i "OK" <d:\fix\cfcsys.txt>nul
if errorlevel 1 exit
command.com /c n:\gamemenu\system\fix.bat >nul
|
|
2008-7-29 20:18 |
|
|
peiliqin
初级用户
 
积分 34
发帖 16
注册 2008-7-24
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
我的理解是你只要有一个不是 OK,就 goto 。find/v 如果找到了一个不是 OK 的,就返回退出码0,如果没找到就返回1,说明都是 OK 。为什么“总是不能确定errorlevel的值”?
我测试了,1跟0的效果一样。2的时候就完全是另外一个效果了。我可以在windows下的cmd查看上一个命令的返回码,但是在纯dos下,不知道怎么看。
My understanding is that as long as you have one that is not OK, you goto. find/v. If you find one that is not OK, return exit code 0. If none are found, return 1, indicating that all are OK. Why does "always fail to determine the errorlevel value"?
I tested, the effects of 1 and 0 are the same. When it's 2, it's completely a different effect. I can check the return code of the previous command in cmd under Windows, but under pure DOS, I don't know how to check it.
|
|
2008-7-29 21:34 |
|
|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
|
2008-7-29 21:39 |
|