Topic awaiting preservation: Putting mulitple files in array - DOS (Page 1 of 1) |
|
---|---|
Maniac (V) Inmate From: there...no..there..... |
posted 08-16-2005 00:28
I need to some funky stuff using a batch file in DOS and need some help. Here is what I need to do code: FORFILES -pC:\MyFolder -m*.PDF -clpr -S 192.168.1.50 -P 2075
code: lpr -S 192.168.1.50 -P 2075 "myfile.PDF"
|
Maniac (V) Inmate From: Lebanon |
posted 08-16-2005 11:04
Hello CPrompt, code: rem save current directory pushd . cd YOURTARGET_DIR rem use command on each file for %a in (*.pdf) do lpr -S 192.168.1.50 -P 2075 %a rem restore old directory popd
|
Maniac (V) Inmate From: there...no..there..... |
posted 08-16-2005 12:19
Hey lallous. Thanks. I will give that a go. Much more simple than some of the things I was trying |
Maniac (V) Inmate From: there...no..there..... |
posted 08-16-2005 14:33
Worked like a charm. I actually just changed one thing. On the variable it needs 2 %'s code: FOR %%a IN (*.txt) DO lpr -S 192.1.50.206 -P 3800 %%a |
Maniac (V) Inmate From: Lebanon |
posted 08-16-2005 14:53
Yes true, if you are to use it in a batch file you have to use '%%' but if you want to use it from command line you use only one '%' |