![]() |
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 04:41 |
47,815 topics / 349,930 posts / today 0 new / 48,291 members |
| DOS批处理 & 脚本技术(批处理室) » Help: About the prompt of not finding the batch processing |
| Printable Version 2,779 / 15 |
| Floor16 qzwqzw | Posted 2007-06-28 09:29 |
| 银牌会员 Posts 636 Credits 2,343 | |
|
Some examples of batch self-deletion were discussed before.
Because that error is prompted when the cmd deletes the file and then reads the file again. So adding 2>nul after del is not useful. The simplest is to use cmd /k to restart a new cmd session. Naturally, the error in the original session is discarded. This sentence is applicable to dos and cmd: %comspec% /k del %0 There can be the following changes in cmd %comspec% /k del "%~0" /a /f 2>nul ---------------------------------------------- Another extreme method is First, shield the output of the standard error device and then delete. Use ctty nul under dos Use cd. 2>nul 3>nul under cmd But its side effects are also very large. The current environment in dos no longer processes any input and output. The system is in a pseudo-dead state. So it is usually used for the situation where all operations are completed in the batch processing and then restart directly. In cmd, all subsequent errors in the current session are not output. So generally, a new cmd session needs to be opened to run the batch processing and then exit this session. -------------------------------------------------------------- Other methods have also been discussed. But I can't remember clearly. Probably also using auxiliary batches or other scripts |
|
| Prev 1 2 |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |