![]() |
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-09 22:48 |
47,811 topics / 349,897 posts / today 2 new / 48,255 members |
| DOS批处理 & 脚本技术(批处理室) » How to add >nul 2>nul at the end of each line in a batch script |
| Printable Version 2,490 / 17 |
| Floor1 kidzgy | Posted 2008-09-09 19:16 |
| 中级用户 Posts 129 Credits 262 | |
|
It's a bit too inconvenient, but if you don't want it to display, you can only manually add " >nul 2>nul" to each line. Remember: " >nul 2>nul" (excluding the double quotes, but there's a space in front to avoid conflicts with the command. How to drag a certain cmd or bat to this batch processing icon to automatically add " >nul 2>nul" to the end of each line. Remember, it's to be achieved by dragging to the icon, not by running the batch processing first and entering the path. Create another file after the command to avoid overwriting the source file.
|
|
| Floor2 hackate | Posted 2008-09-09 19:40 |
| 中级用户 Posts 125 Credits 228 | |
|
I don't know what you don't want him to display?
@echo off You can not display the running commands. Only some execution results need >nul 2>nul Not all need >nul2 >nul |
|
| Floor3 hackate | Posted 2008-09-09 19:43 |
| 中级用户 Posts 125 Credits 228 | |
|
Also. It's impossible to achieve the result by throwing the file onto the batch processing icon. It seems it can't be done.
But you can open the batch processing and then drag the file you want to process into the batch processing. That can be done. Hehe |
|
| Floor4 s11ss | Posted 2008-09-09 19:49 |
| 银牌会员 Posts 566 Credits 2,098 | |
|
|
|
| Floor5 metoo | Posted 2008-09-09 22:32 |
| 初级用户 Posts 93 Credits 195 | |
|
Use an editor with regular expressions, such as EP. Replace - check the regular expression - $ followed by a space >nul 2>nul. Done
|
|
| Floor6 kidzgy | Posted 2008-09-10 19:41 |
| 中级用户 Posts 129 Credits 262 | |
|
2nd floor, that's a wrong statement!
Using the reg command will prompt that the operation is successful, and then it will be displayed. The 4th floor doesn't work. |
|
| Floor7 hackate | Posted 2008-09-10 20:06 |
| 中级用户 Posts 125 Credits 228 | |
|
I'm sorry, I didn't even know this could be done..
But the method on the 4th floor really works. Why do you say it doesn't work? Did you make a mistake there? Otherwise, it passed my test here. |
|
| Floor8 HAT | Posted 2008-09-10 20:33 |
| 版主 Posts 5,017 Credits 9,023 | |
|
Q: Why doesn't it work?
A: Find an old military doctor's phone on the utility pole. He specializes in and cures this. If the treatment cycle is long, it is recommended to list your test environment, test cases, and error messages for everyone to help you solve the problem. |
|
| Floor9 airstop | Posted 2008-09-10 22:38 |
| 初级用户 Posts 12 Credits 24 | |
|
Haven't heard of it being possible like this, it's too amazing
|
|
| Floor10 kidzgy | Posted 2008-09-11 19:11 |
| 中级用户 Posts 129 Credits 262 | |
|
You write taskkill /im explorer.exe /f in the BAT, then save it and drag it in to see it~
|
|
| Floor11 hackate | Posted 2008-09-11 20:23 |
| 中级用户 Posts 125 Credits 228 | |
|
Please provide the specific code that needs to be translated. Since you haven't provided the code content yet, please paste the relevant code here.
|
|
| Floor12 everest79 | Posted 2008-09-11 22:45 |
| 金牌会员 Posts 1,127 Credits 2,564 | |
|
batch.cmd >nul 2>nul
|
|
| Floor13 kidzgy | Posted 2008-09-12 17:03 |
| 中级用户 Posts 129 Credits 262 | |
|
The original Chinese text is about code conversion. The first code is `taskkill /im explorer.exe /f` and the converted one is `taskkill >nul 2>nul`. Since the task is just to present the conversion result as required, the translated result is:
|
|
| Floor14 s11ss | Posted 2008-09-12 17:07 |
| 银牌会员 Posts 566 Credits 2,098 | |
Originally posted by kidzgy at 2008-9-12 05:03 PM: Change to: [ Last edited by s11ss on 2008-9-12 at 05:13 PM ] |
|
| Floor15 kidzgy | Posted 2008-09-12 19:27 |
| 中级用户 Posts 129 Credits 262 | |
|
Well, it works, thank you~!
|
|
| 1 2 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |