Page 1 of 1

Redirecting output to a text file in Textpad?

Posted: Thu Jan 08, 2004 2:09 am
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.

Posted: Thu Jan 08, 2004 2:33 am
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!

Printing from a command window

Posted: Thu Jan 08, 2004 2:50 am
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.

Posted: Thu Jan 08, 2004 6:24 pm
by Gee
kool, thanks - i will check it out! 8)