helencrump
helencrump

Reputation: 1389

Batch script: Open text file and scroll to bottom

I've got a text file that I'd like to open using a batch script. Once it's open, I'd like to simulate pressing CTRL + END on the keyboard so that the cursor is placed at the very bottom of the file.

I can open the file in Notepad by using start /max myFile.txt, but I'm struggling on how to navigate to the bottom. I've read about a SendKeys function, but I can't seem to get this to work with sending ^{END} to my file (I've read mixed information about whether it's available in batch scripting or not).

Any help is greatly appreciated!

Upvotes: 2

Views: 2311

Answers (1)

npocmaka
npocmaka

Reputation: 57282

Here it is a way with sendKeys.bat

start /max notepad myFile.txt
call sendkeys.bat "myFile.txt" "^{END}"

Upvotes: 1

Related Questions