Solved

How to print a .doc file from dos

Posted on 2003-10-22
13
713 Views
Last Modified: 2007-12-19
Hi guys,

My computer and My printer is on a network. The problem is that the printer is not shared. Even though i can print through it. All i have is its IP address and sharename. How can I print through it?

This wont work.
PRINT c:\temp\copy.txt

because i havent specified the device.
I am using W2K. Please HELP!! I would give more points but thats all I have left.
0
Comment
Question by:Khansufyaan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
13 Comments
 
LVL 30

Expert Comment

by:SteveGTR
ID: 9606984
Does the printer have a name? If so them do this:

print /d:\\printername\sharename c:\temp\copy.txt

Good Luck,
Steve
0
 

Author Comment

by:Khansufyaan
ID: 9608374
C:\>print /d:\\bur-print-02\P10-HEAD HUNTER c:\temp\copy1.txt

C:\>copy con: lpt1:

This is what I got. But it didnt print at all.
0
 
LVL 30

Expert Comment

by:SteveGTR
ID: 9608686
Try this:

print /d:"\\bur-print-02\P10-HEAD HUNTER" c:\temp\copy1.txt

That should handle the spaces in the sharename.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:Khansufyaan
ID: 9609040
nope didnt work, still gave same results
0
 
LVL 30

Expert Comment

by:SteveGTR
ID: 9609334
What happens when you try the command:

print /d:"\\bur-print-02\P10-HEAD HUNTER" c:\temp\copy1.txt
0
 

Author Comment

by:Khansufyaan
ID: 9609568
C:\>print /d:"\\bur-print-02\P10-HEAD HUNTER" c:\temp\copy1.txt

C:\>copy con: lpt1:

Same result as last time. The printer is right infront of me but no printing going on.
0
 
LVL 30

Expert Comment

by:SteveGTR
ID: 9610324
Don't no why you are doing:

copy con: lpt1:

When you do this:

print /d:"\\bur-print-02\P10-HEAD HUNTER" c:\temp\copy1.txt

What is displayed at the DOS prompt? On my machine it is:

C:\Temp\temp.dat is currently being printed

Does it say that?
0
 

Author Comment

by:Khansufyaan
ID: 9610348
Hi,

I only type
 print /d:"\\bur-print-02\P10-HEAD HUNTER" c:\temp\copy1.txt

the next line comes up by itself

copy con: lpt1:

and then it stays that way without printing. It freezes.
0
 
LVL 30

Expert Comment

by:SteveGTR
ID: 9610733
What happens when you type print /?

On my NT2000 machine the following prints:

PRINT [/D:device] [[drive:][path]filename[...]]

   /D:device   Specifies a print device.

I don't know where the copy con: lpt1: comes from, but you might be able to get out of that by pressing CTRL-Z.
0
 

Author Comment

by:Khansufyaan
ID: 9610775
C:\>print/?

C:\>copy con: lpt1:
^Z
        1 file(s) copied.

C:\>Now is the time for all good men to come to the aid of their country.
'Now' is not recognized as an internal or external command,
operable program or batch file.

C:\>L
'L' is not recognized as an internal or external command,
operable program or batch file.

C:\>Z
'Z' is not recognized as an internal or external command,
operable program or batch file.
-------------------------------------------------

As you can see all i did was print /? and the second line came by itself and got stuck, then when I pressed CTRL-Z it gave me

^Z
        1 file(s) copied.

C:\>Now is the time for all good men to come to the aid of their country.
'Now' is not recognized as an internal or external command,
operable program or batch file.

C:\>L
'L' is not recognized as an internal or external command,
operable program or batch file.

C:\>Z
'Z' is not recognized as an internal or external command,
operable program or batch file.
-------------------------------------------------
0
 
LVL 30

Accepted Solution

by:
SteveGTR earned 25 total points
ID: 9610846
You have a program named print that is doing some wacky stuff. The print I'm using is:

%SystemRoot%\SYSTEM32\PRINT.EXE

Try:

%SystemRoot%\SYSTEM32\PRINT.EXE /d:"\\bur-print-02\P10-HEAD HUNTER" c:\temp\copy1.txt

Here is the file information for my version of PRINT.EXE

07/26/2000  12:00p              10,000 PRINT.EXE
0
 

Author Comment

by:Khansufyaan
ID: 9610894
DUDE, YOU ROCK!

That worked. Hats off to SteveGTR.

Now the only thing that bugs me is how can i define to print in Landscape vs. Portrait. By default it prints Portrait, but how do i define if I want to print Landscape. Plus what other options and features can I tweek while printing from dos?
0
 
LVL 30

Expert Comment

by:SteveGTR
ID: 9610963
You should really ask another question for that, but I know you are hurting for points :)

You can create a file that has the printer control sequence appropriate for your printer and do this:

%SystemRoot%\SYSTEM32\PRINT.EXE /d:"\\bur-print-02\P10-HEAD HUNTER" c:\whereever\landscape.dat+c:\temp\copy1.txt

You should also probably create a file that resets the printer so that you clean up afterwards. Then you would say:

%SystemRoot%\SYSTEM32\PRINT.EXE /d:"\\bur-print-02\P10-HEAD HUNTER" c:\whereever\landscape.dat+c:\temp\copy1.txt+c:\whereever\reset.dat

0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
For loop to add numbers 3 103
DOS Command to remove CR/LF to have one id and one text per line 13 73
file size 9 58
access denied when running native SQL tool: SQLIOSIM 2 65
The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question