联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
Originally posted by lxmxn at 2006-10-28 13:09: 不难看出,以上willsort兄写的批处理要在系统盘根目录中运行,而这段代码中并没有删除"boot.ini"文件的语句,但是后面的这句让我感到质疑:"copy %temp%\boot.new boot.ini>nul 2>nul",这里会把"%temp%\boot.new" copy 到当前的工作目录中来,也就是 copy 到系统盘的根目录中来,并且将文件名改为"boot.ini",而此时系统盘的根目录里面已经有了一个"boot.ini"文件,这时 copy 命令就要询问你是否改写原来的"boot.ini"文件,而willsort兄只是简单的在后面加上">nul 2>nul"这个屏蔽的语句,这样一来,系统就好象死锁在一种询问的状态,当然CMD窗口并没有任何的提示。这显然没有达到我们的目的,结果显然是 copy 失败了。
Originally posted by lxmxn at 2006-10-28 13:09: It is not difficult to see that the above batch processing written by brother willsort needs to be run in the root directory of the system disk, and there is no statement to delete the "boot.ini" file in this code. But the following sentence makes me question: "copy %temp%\boot.new boot.ini>nul 2>nul". Here, it will copy "%temp%\boot.new" to the current working directory, that is, to the root directory of the system disk, and change the file name to "boot.ini". At this time, there is already a "boot.ini" file in the root directory of the system disk. At this time, the copy command will ask you whether to rewrite the original "boot.ini" file. However, brother willsort simply adds the " >nul 2>nul" shielding statement at the back. In this way, the system seems to be deadlocked in a questioning state. Of course, the CMD window has no prompts. This obviously does not achieve our purpose, and the result is obviously a copy failure.