中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-19 13:54
47,814 topics / 349,908 posts / today 0 new / 48,259 members
DOS疑难解答 & 问题讨论 (解答室) » [Help][Discussion] Is there any expert who can achieve this function under pure DOS?
Printable Version  3,370 / 33
Floor1 peiliqin Posted 2008-07-27 02:31
初级用户 Posts 16 Credits 34
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 ]
Floor2 peiliqin Posted 2008-07-27 21:24
初级用户 Posts 16 Credits 34
Use other methods, be flexible, or are there other DOS software that can do it?
Floor3 peiliqin Posted 2008-07-28 00:33
初级用户 Posts 16 Credits 34
Use other methods, be flexible, or are there other DOS software that can do it? Why is there no one answering?
Floor4 peiliqin Posted 2008-07-28 00:38
初级用户 Posts 16 Credits 34
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.
Floor5 DOSforever Posted 2008-07-28 00:41
金牌会员 Posts 2,239 Credits 4,639
I don't know the specific content of the file d:\fix\cfcsys.txt. According to your original meaning, as long as the second word in any line is not "OK", then goto end, that is, each line should have the word "OK". For simplicity, use find /v combined with errorleverl to judge. And why use command/c?
Floor6 quya Posted 2008-07-28 19:53
高级用户 Posts 172 Credits 558 From 江苏
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.
Floor7 DOSforever Posted 2008-07-28 21:17
金牌会员 Posts 2,239 Credits 4,639
It seems quite simple, with nothing complicated. The problem is that his a:\jieguo.txt doesn't seem to have anything to do with d:\fix\cfcsys.txt. Why doesn't he verify OK in a:\jieguo.txt but look for OK in d:\fix\cfcsys.txt?
Floor8 peiliqin Posted 2008-07-29 00:15
初级用户 Posts 16 Credits 34
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.
Floor9 lianjiang2004 Posted 2008-07-29 07:45
金牌会员 Posts 1,884 Credits 3,946
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.
Floor10 peiliqin Posted 2008-07-29 07:59
初级用户 Posts 16 Credits 34
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.
Floor11 peiliqin Posted 2008-07-29 08:01
初级用户 Posts 16 Credits 34
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?
Floor12 DOSforever Posted 2008-07-29 09:56
金牌会员 Posts 2,239 Credits 4,639
Originally posted by peiliqin at 2008-7-29 07:59:

Tried it, but when the file content changes, I can't always determine the errorlevel value. Can't jump.

My understanding is that as long as there is one that is not OK, just goto. If find/v finds one that is not OK, it returns exit code 0. If not found, it returns 1, which means all are OK. Why "can't always determine the errorlevel value"?
Floor13 qzwqzw Posted 2008-07-29 20:18
银牌会员 Posts 636 Credits 2,343
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

Floor14 peiliqin Posted 2008-07-29 21:34
初级用户 Posts 16 Credits 34
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.
Floor15 DOSforever Posted 2008-07-29 21:39
金牌会员 Posts 2,239 Credits 4,639
Please provide the specific Chinese content that needs to be translated. Without the Chinese text to translate, I can't perform the translation.
1 2 3  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023