The command line to open a txt file and point the cursor to End of file (EOF)

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
KSKwin123
Posts: 4
Joined: 21 Dec 2021 23:12

The command line to open a txt file and point the cursor to End of file (EOF)

#1 Post by KSKwin123 » 09 Sep 2022 00:33

I have a batch file will execute some task and it will open the text file.
Now, i want the cursor to set at end of the File (Opened Text file)

_KSK

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: The command line to open a txt file and point the cursor to End of file (EOF)

#2 Post by aGerman » 09 Sep 2022 01:33

As I already told you in your other question about the UAC prompt, Batch is not able to interact with graphical user interfaces. You can't emulate mouse- or keyboard actions.

Steffen

miskox
Posts: 553
Joined: 28 Jun 2010 03:46

Re: The command line to open a txt file and point the cursor to End of file (EOF)

#3 Post by miskox » 09 Sep 2022 05:19

Your file we be opened in notepad so you can use CTRL+END. If this is not what you want see aGerman's reply.

Saso

Aacini
Expert
Posts: 1885
Joined: 06 Dec 2011 22:15
Location: México City, México
Contact:

Re: The command line to open a txt file and point the cursor to End of file (EOF)

#4 Post by Aacini » 09 Sep 2022 08:08

I assume you want to set the file pointer to End Of File in order to append new information to the file. If so, then use >> append redirection:

Code: Select all

(
echo New information
echo More new information
) >> theFile.txt
Note: previous example are commands given at the command line that open a text file and point the "cursor" (File Pointer, really) to End of file, exactly what you requested...

Antonio

Post Reply