Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I'm running an application from a .bat file. How do I make the window scroll up and down?

Tags:

batch-file

My Java application runs from this .bat file

@ECHO OFF
mode con:cols=130 lines=60
CLS
java -cp lib\postgresql-9.0-801.jdbc4.jar;bin telecom.cli.Telecom
PAUSE

A Window opens, the app runs smoothly... But I can't scroll Up and Down.
What do I need to add to this .bat file?

like image 284
athspk Avatar asked Jan 09 '11 17:01

athspk


People also ask

How do I scroll down in cmd?

The more command allows you to see the text files within the command prompt. For bigger files (for example, log files), it shows one screen at one time. The more command is also used to scroll up and down within the page. To scroll up the display one line at a time, press the Enter key.

How do I run a batch file without closing a window?

If you're creating a batch file and want the MS-DOS window to remain open, add PAUSE to the end of your batch file. This prompts the user to Press any key. Until the user presses any key, the window remains open instead of closing automatically.

Can you edit a batch file while it running?

You will be fine as long as you modify the batch file after the current executing line position byte offset at the end of the most recently parsed line of code. If you modify it before then it will start doing strange things (repeating commands etc..).


1 Answers

The simple answer is that the lines parameter can be set to a large value which will create a larger than normal window which will be scrollable.

The happy answer is that the mode command is not required. Simply create a shortcut. In the shortcut Properties\Layout set the Screen buffer size (Width: 130, Height: {maximum 9999}), Window Size (Width: 130, Height: {25 for example}) This will create a window 130*25 and the buffered contents (up to a maximum of 9999 lines) will be scrollable.

like image 111
Mike Gonta Avatar answered Sep 21 '22 04:09

Mike Gonta