![]() |
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-11-11 13:49 |
47,815 topics / 349,930 posts / today 0 new / 48,291 members |
| DOS疑难解答 & 问题讨论 (解答室) » How to obtain the value returned after a command is executed |
| Printable Version 4,125 / 38 |
| Floor16 kavenlee72 | Posted 2008-01-04 14:05 |
| 中级用户 Posts 87 Credits 369 | |
|
I have downloaded the pure DOS version of sed from your Google forum and copied it to the C drive. I also modified test1.bat and test2.bat according to your code, but the following error still occurs:
c:\>type a.txt 19 c:\>test1 General error reading drive F A: Abort, R: Retry, F: Fail? a c:\> I don't know what's wrong. Please ask the experts for advice. |
|
| Floor17 kavenlee72 | Posted 2008-01-04 14:11 |
| 中级用户 Posts 87 Credits 369 | |
|
Re - test found that when entering sed /? at the command line, the following appears:
General error reading drive F A: Abort, R: Retry, F: Fail? a Test environment: DOS 7.1 |
|
| Floor18 fastslz | Posted 2008-01-04 14:18 |
| 铂金会员 Posts 2,315 Credits 5,493 From 上海 | |
|
Oh, you're too... Is the C drive Fat32? Is the C drive in the Path? Is the C drive indeed drive C under DOS? Under DOS, first find sed, or put sed test1 test2 together
|
|
| Floor19 kavenlee72 | Posted 2008-01-04 15:00 |
| 中级用户 Posts 87 Credits 369 | |
|
They are together, and it's a DOS virtual machine made with Microsoft Virtual PC. The file format is Fat32, and the installed system is DOS 7.1. All the files are in the same directory. test1.bat, test2.bat, sed.exe, and the previously mentioned find.exe, etc., are all together. Thanks!
|
|
| Floor20 kavenlee72 | Posted 2008-01-04 15:02 |
| 中级用户 Posts 87 Credits 369 | |
|
I'm sorry, they are all placed in the root directory of drive C:, including A.TXT. They were copied from drive E:. The same problem occurs under drive E:.
|
|
| Floor21 fastslz | Posted 2008-01-04 15:35 |
| 铂金会员 Posts 2,315 Credits 5,493 From 上海 | |
|
You need to change your path variable, otherwise there will be endless troubles.
Or try this: @echo off :start1 [ Last edited by fastslz on 2008-1-4 at 03:36 PM ] |
|
| Floor22 kavenlee72 | Posted 2008-01-04 16:42 |
| 中级用户 Posts 87 Credits 369 | |
|
c:\>type a.txt
2 General error reading drive F A: Abort, R: Retry, F: Fail? f Load error: no DPMI - Get csdpm*b.zip When the "General error reading drive F" prompt appears, entering "f" results in "Load error: no DPMI - Get csdpmi*b.zip" Ask: What is "DPMI"? What does the above mean? How to solve it? |
|
| Floor23 fastslz | Posted 2008-01-04 17:32 |
| 铂金会员 Posts 2,315 Credits 5,493 From 上海 | |
|
Oh, I also overlooked that DPMI is DOS Protected Mode Interface, which provides protection mode support under DOS
http://www.cn-dos.net/forum/viewthread.php?tid=17093&fpage=1&highlight=DPMI |
|
| Floor24 fastslz | Posted 2008-01-04 17:49 |
| 铂金会员 Posts 2,315 Credits 5,493 From 上海 | |
|
Tested this one and it's not very stable. Download the one recommended by the webmaster:
http://www.cn-dos.net/forum/viewthread.php?tid=18577&fpage=1 |
|
| Floor25 kavenlee72 | Posted 2008-01-04 18:20 |
| 中级用户 Posts 87 Credits 369 | |
|
Thanks for the instruction. Run again:
C:\>DPMI.EXE C:\>TYPE A.TXT 2 C:\>TEST1 C:\>TYPE A.TXT 2 After running DPMI.EXE, there are no errors, but the content in A.TXT is not added and remains the original value. Also, does DPMI need to be run once before each time sed.exe is run? Thanks! |
|
| Floor26 fastslz | Posted 2008-01-04 19:16 |
| 铂金会员 Posts 2,315 Credits 5,493 From 上海 | |
|
I also tried, it's still unstable.
You can download the latest version of DPMI here http://japheth.de/Download/HXRT.ZIP sed.exe can also consider using the latest version. vkill has 3 versions of sed http://www.vkill.net |
|
| Floor27 kavenlee72 | Posted 2008-01-04 22:57 |
| 中级用户 Posts 87 Credits 369 | |
|
The expert upstairs, the problem still hasn't been solved! Help me, thank you!
The sed.exe in Http://www.vkill.net was not found |
|
| Floor28 fastslz | Posted 2008-01-05 14:16 |
| 铂金会员 Posts 2,315 Credits 5,493 From 上海 | |
| Floor29 kavenlee72 | Posted 2008-01-05 16:55 |
| 中级用户 Posts 87 Credits 369 | |
|
The problem is not solved, and I won't add it! :(:(:(
Asking boss fastslz, is there a way to solve it? Thank you! [ Last edited by kavenlee72 on 2008-1-5 at 06:58 PM ] |
|
| Floor30 everdos | Posted 2008-01-05 20:21 |
| 初级用户 Posts 21 Credits 52 | |
|
Try using fc
test1.bat -------------------------------------------------------------------------------------------- @echo off call test2.bat 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 type A.TXT -------------------------------------------------------------------------------------------- test2.bat -------------------------------------------------------------------------------------------- :start1 echo %1 > A2.TXT fc A.TXT A2.TXT > nul shift if "%1"=="" goto end if errorlevel 1 goto start1 echo %1 > A.TXT :end |
|
| Prev 1 2 3 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |