![]() |
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-04 12:07 |
48,038 topics / 350,123 posts / today 0 new / 48,251 members |
| DOS批处理 & 脚本技术(批处理室) » Why can " <nul " in "set /p=1< nul" display characters without line breaking? |
| Printable Version 2,081 / 3 |
| Floor1 huzixuan | Posted 2007-05-02 09:23 |
| 高级用户 Posts 219 Credits 537 From 芜湖 | |
|
set /p=1<nul
set /p=2<nul Why does using "<nul" make it not wrap and display characters? How to explain it?? |
|
| Floor2 bjsh | Posted 2007-05-02 11:02 |
| 银牌会员 Posts 621 Credits 2,000 | |
|
Usage of set /p:
set /p variable=prompt string: Output the prompt string in the console; assign the user's input (ended by pressing Enter) to the variable; note that the user's input is on the same line; Its own characteristics determine that it can not wrap lines; <nul assigns an empty string to the variable to shield the user's input, so it seems that it just displays the prompt string on the console without requiring the user to input; at the same time, note that there is no carriage return passed, so there will be no line break; In this case, the variable can be omitted.. Abbreviated as set /p=prompt string<nul |
|
| Floor3 bjsh | Posted 2007-05-02 11:03 |
| 银牌会员 Posts 621 Credits 2,000 | |
|
ps: This kind of problem has been said a lot...
Please search first |
|
| Floor4 huzixuan | Posted 2007-05-02 13:53 |
| 高级用户 Posts 219 Credits 537 From 芜湖 | |
|
Thanks, next time I'll be careful.
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |