Redirecting output to a text file in Textpad?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Gee
Posts: 2
Joined: Thu Jan 08, 2004 2:03 am

Redirecting output to a text file in Textpad?

Post by Gee »

I am writing Java applications. I need to be able to redirect the output from my programs to a textfile instead of to the screen.

How do I do this in TextPad? Is it Possible?
The DOS command would be java Hello > output.txt as an example.

Your help would be greatly appreciated.

Surely this must be possible. Also is it possible to redirect straight to the printer?

Thanks in Advance

Gee.
User avatar
CyberSlug
Posts: 120
Joined: Sat Oct 04, 2003 3:41 am

Post by CyberSlug »

cmd /c start "" java Hello > output.txt
Might work for Windows 2000/XP (use command for Windows 9x)

as far as printing.... maybe
copy filename lpt1 /b

Someone more familiar with DOS/Batch command probably knows!
User avatar
talleyrand
Posts: 624
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Printing from a command window

Post by talleyrand »

I think you might have to snag a printer to use lpt1. To test, try
c:\>echo Hello World > lpt1

If nothing prints, you'll probably need to capture the printer to lpt1. Syntax isn't hard, same as accessing any other network device.
C:\>net use lpt1 \\printServer\printerName

It's been too long since I've printed from the command line but it might need a ctrl-Z after World and before the redirect (>) for echoing data. Unfortunately, I don't have a printer at home so I can't test. At any rate, Slug's got the format right, just copy the file onto lpt1 (once it's mapped) and away it'll go.
I choose to fight with a sack of angry cats.
Gee
Posts: 2
Joined: Thu Jan 08, 2004 2:03 am

Post by Gee »

kool, thanks - i will check it out! 8)
Post Reply