Last Line of a CMD window
Moderator: DosItHelp
Last Line of a CMD window
I was wondering about this ever since I started to learn about batch programming. As you see in the screenshot I have provided, I have set the console window to 30 cols wide and 10 cols high, and I've echoed 10 lines and did `pause >nul` after that. But the first line seems to have disappeared? I think pause >nul OR the cursor is causing this, but is there any actual way to pause the script without making a new line? Thanks to everyone who helps.
- Attachments
-
- (Screenshot of my problem)
- program.png (28.87 KiB) Viewed 2543 times
Re: Last Line of a CMD window
Yes. Your problem is not caused by the pause command, but by the last echo 10 that advance the cursor to new line.
To show text with no CR+LF at end, use:
But be aware that any leading space (or control character) in the text will be supressed...
For example, in your code:
PS - In future questions do not post code (or data) in an image. Instead, enclose the code between [code] and [/code] tags (lines).
To show text with no CR+LF at end, use:
Code: Select all
set /P "=This text leaves cursor in same line" < NUL
For example, in your code:
Code: Select all
set /P "=10" < NUL
Re: Last Line of a CMD window
Thanks for your advice!