Open in Notepad

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Tr1plex
Posts: 4
Joined: 26 Nov 2012 19:06

Open in Notepad

#1 Post by Tr1plex » 26 Nov 2012 19:18

I apologize if this has been asked before.

I'd like to have an option to "Open in Notepad".
Is it possible to have all text in the prompt window open in notepad without sending every line to a temp file?

Tr1plex
Posts: 4
Joined: 26 Nov 2012 19:06

Re: Print to Notepad

#2 Post by Tr1plex » 26 Nov 2012 21:14

Thank you for your response. Unfortunately, my question was vague.

Currently, my programs, though fairly simple, contain and produce a great deal of text.
I decided that I want an "Open in Notepad" option to them.
I'm not thinking it's possible, but, was hoping that there might be some form of shortcut that would open whatever is in the CP into Notepad without having to add ">> sometext.txt" to every "echo" line.
I'm really just trying to be lazy. :)

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Print to Notepad

#3 Post by Ed Dyreen » 26 Nov 2012 21:24

I'll assume CP stands for Console Pane..

There is a program to copy to clipboard directly from batch.
Otherwise outputting a file is the only solution ( apart from manually copiyng text ).

Tr1plex
Posts: 4
Joined: 26 Nov 2012 19:06

Re: Print to Notepad

#4 Post by Tr1plex » 26 Nov 2012 21:53

Ed Dyreen wrote:I'll assume CP stands for Console Pane..


Actually, it's Console Pain. :)

So yeah, that's what I was afraid of.
I'll check out that program though.

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

Re: Print to Notepad

#5 Post by Aacini » 26 Nov 2012 23:37

Excuse me. Your question is very vague indeed! Just a point before the answer:

You may send any text you want to a disk file, that in turn you may open with Notepad, or with any other text editor, or even show it in the screen with TYPE or MORE commands in a DOS Window. This is an usual operation.

On the other hand, if you want a Batch program to send text directly to a running Notepad.exe program, then it is much more difficult. I assume that you want NOT this option, but just send all the output your program show in the screen to a temp file.

You can do that by typing this line from the command-prompt:

Code: Select all

yourBatFile > temporaryFile.txt
Please note that ALL TEXT that the program normally show in the screen will be redirected to the disk file! If the program have any SET /P command requesting any input, you will NOT see the prompt, so this form of execution is usually reserved for an automatic execution of the Batch file. For example, you may prepare a text file with the standard input for the program and then execute it this way:

Code: Select all

yourBatFle < inputToBat.txt > temporaryFile.txt

I hope it helps...

Antonio

Tr1plex
Posts: 4
Joined: 26 Nov 2012 19:06

Re: Print to Notepad

#6 Post by Tr1plex » 27 Nov 2012 20:55

That's it!!!
That's what I was looking for!

Thank you!

Post Reply