I am trying to use the Print command within a batch file to print a
local file to a network printer. In Dos, I get a message saying print
job is being sent, and return to prompt. But nothing ever joins the
print queue. This is what I am doing :
using isql to extract info, and then creating a file (test.txt) with
the info.
I then try : print C:\test\test.txt within the batch file, but no
printout. I tried it in Dos as well, with no luck.
The printer is a networked printer, off one of our servers. Any ideas
on how to fix this.
Thanks a lot
David
Print is a kind of print spooler, normally linked to LPT1. It is not
really necessary to send files to a printer, the COPY command will
suffice. Further, are you sure the printer is connected at the 'DOS'
level. A NET /STATUS should show all logins and mappings available at
the command prompt (and thereby to the batch process). Clearly, there
is a disconnect. It is possible all of your attempts are still in
PRINT's queue (or they might have just been sent to the byte bucket).
I believe you can simply use ...
copy C:\test\test.txt LPTn
if the port number 'n' is already properly mapped or
copy C:\test\test.txt \\servername\printername
if it's not.
Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/
In article <37C415...@pressroom.com>, lav...@pressroom.com says...
You could try using my shareware printing utility, Imprint,
to print your files. It can be run from a batch file or
dos window, but not from a machine running in dos mode.
It has many options for modifying the output of the text
files it prints, for example the font used, the line spacing,
the header/footer information, line wrapping. It is also
easy to specify which printer the file should be sent to.
Jon
--------------------------------------------------------------------
Jon Eva mailto:jon...@gallicrow.co.uk
Gallicrow Software Limited http://www.gallicrow.co.uk
Home of Imprint - a utility for printing text and binary files
--------------------------------------------------------------------
In article <37c3fad2...@news.ftech.net>,
David wrote:
>
> I am trying to use the Print command within a batch file to print a
> local file to a network printer. In Dos, I get a message saying print
> job is being sent, and return to prompt. But nothing ever joins the
> print queue. This is what I am doing :
>
> using isql to extract info, and then creating a file (test.txt) with
> the info.
>
> I then try : print C:\test\test.txt within the batch file, but no
> printout. I tried it in Dos as well, with no luck.
>
> The printer is a networked printer, off one of our servers. Any ideas
> on how to fix this.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Absolutely! A very good point.
BTW, text files can also be sent to the 'default Windows printer' using
Notepad with a /P command line switch, as in ...
notepad /p c:\test\test.txt
or ...
start /W notepad /p c:\test\test.txt
if it is desired to have the procedure wait for the print job to finish
before continuing (though I can't think of why that would be of
interest). I thought of that after I had posted the response yesterday.
Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/
> In article <37C415...@pressroom.com>, lav...@pressroom.com says...
> > David wrote:
> > >
> > > Hi all
> > >
> > > I am trying to use the Print command within a batch file to print a
> > > local file to a network printer. In Dos, I get a message saying print
> > > job is being sent, and return to prompt. But nothing ever joins the
> > > print queue. This is what I am doing :
> > >
> > > using isql to extract info, and then creating a file (test.txt) with
> > > the info.
> > >
> > > I then try : print C:\test\test.txt within the batch file, but no
> > > printout. I tried it in Dos as well, with no luck.
> > >
> > > The printer is a networked printer, off one of our servers. Any ideas
> > > on how to fix this.
> > >
In article <37C536...@pressroom.com>, lav...@pressroom.com says...