# print with dos command



## lemings (Jul 7, 2009)

hi there,

i'd like to know if there is a dos command to send an order to a specific
printer for printing all documents at a specific folder

thanks


----------



## Squashman (Apr 4, 2003)

If you have a printer hooked up to an LPT port.
TYPE FILE.TXT > LPT1
COPY /B *.TXT LPT1

There is another program that may do what you want. It is called PrintFile. You can set it up to watch a directory and when a document is dropped into it, it will print the file.

What kind of documents are you wanting to print.


----------



## lemings (Jul 7, 2009)

i'd like to print all pdf documents in a folder, i've tested the print command, but it print in a paper (ur document is being succesufuly printed) but it doesnt print the content of the document, also the printer
is a network printer, 

if u have any suggestions,

with pleasure


----------



## Squashman (Apr 4, 2003)

This should work for you.
http://www.print-conductor.com/


----------



## lemings (Jul 7, 2009)

the print conductor will print the documents at a specific folder, but
i'd like to do this automatically with a bat file, i dont want to open the
programm and lanch the printer, im wondering if it can be done by a
command

thank u for helping


----------



## lemings (Jul 7, 2009)

i've got to explain :
first problem i've encountered, is how to move pdf files from folders and subfolders, i've find this and it works :

For /F "tokens=*" %%A in ('dir /b /s "C:\test\*.txt"') do (
move /y "%%A" C:\test2
)

secondly, i'd like to print all the documents moved so i've tried this :

net use lpt1: \\srv-casablanca\imprimante
print c:\test2\*.pdf

but it prints me the papers with one line each :
?????????????????????????????????????????????????
this is the line, id like to see the contents not ???

can u help

thanks


----------



## Squashman (Apr 4, 2003)

Print only prints text files. You will need a Vbscript to invoke the correct program to print the file. There was a thread about this a couple of years back, I just can't recall which one.


----------



## Squashman (Apr 4, 2003)

Should have known Rob would have a script for this.
http://www.robvanderwoude.com/printfiles.php


----------



## lemings (Jul 7, 2009)

i didnt test the script to print pdf files cause i got a little problem
in move command, i tried to do :

move c:\test pdf c:\pdf file

but it seems like move dont accept spaces in folders name

is there anyway to get out of this

thanks for helping


----------



## Squashman (Apr 4, 2003)

"quotes"


----------



## lemings (Jul 7, 2009)

i've tried quotes, but it doesnt work, here is the command :

For /F "tokens=*" %%A in ('dir /b /s "H:\partage\devis courrier\devis sb\*.pdf"') do (
move /y "%%A" H:\partage\devis courrier\divers
)

i've tried like that :
first :

For /F "tokens=*" %%A in ('dir /b /s "H:\partage\devis courrier\devis sb\*.pdf"') do (
move /y "%%A" "H:\partage\devis courrier\divers"
) doesnt work

second :

For /F "tokens=*" %%A in ('dir /b /s ""H:\partage\devis courrier\devis sb\*.pdf""') do (
move /y "%%A" "H:\partage\devis courrier\divers"
) doesnt work

can u help please


----------



## Squashman (Apr 4, 2003)

Telling us it doesn't work really doesn't help. Do you have echo turned on in your script to see what it is doing? Are you getting any error messages?

It looks like you have the proper syntax as far as the first one goes. The only thing I can see is maybe you have a misspelling. Is it suppose to be *divers* or *drivers*

This should work

```
For /F "tokens=* delims=" %%A in ('dir /b /s "H:\partage\devis courrier\devis sb\*.pdf"') do (
move /y "%%A" "H:\partage\devis courrier\divers"
)
```
wouldn't hurt to add a delims= after the tokens options to tell it not to use any delimiters.


----------



## lemings (Jul 7, 2009)

hey friend,

it works with 2 subfolders but i have to test it with 400 subfolders, till that thank u deeply.

wondering if u can help in excell too, if it is, here is the case, if it's not
thank u again :

i have an excell file wich i shared with some users, i got total control
of it and all users have the only-read, we all open the file, and i'd like
to modify it and will be seen by all the others users without they close
and re-open the file, is it possible ?

thank u once again


----------



## Squashman (Apr 4, 2003)

_Posted via Mobile Device_
You should start another thread as it is totally unrelated to this one. But my gut feeling is no.


----------

