|
| |||||||||
| Tags: batch file automation, cmd printing, local system, schtasks |
![]() |
| | Thread Tools | Search this Thread |
|
#16
| |||
| |||
| Re: scheduled printing of a text file using batch files or schtasks
Gadgetman wrote: > Klaus Jorgensen;3796335 Wrote: >> Try redirecting the output of the lpr command to a log file: >> lpr -S MyIP_address -P 8550dp blank.txt >lpr.log > > I've attempted to try your suggestion for redirecting the output of the > lpr command to a log file. (The log file remains blank?) > > Question:could it be due to the raw file data being passed? > Also: do you have an example of a known working batch file syntax for > using the LPR command? If a log file is created and is empty, the lpr command is ok. If the raw file is empty, the printer might probably just ignore the file - try grab the output of a Windows test print to a test.prn and use that file with the lpr command. Also, the printer could be restrictive with the port name, try using lpt1, lp1 or pr1 instead of 8550dp. If a printer server box (e.g. JetDirect) has more than one port, the port name must specify the actual port, but with a built-in network card in the printer, it shouldn't really matter. /klaus |
|
#17
| |||
| |||
| Re: scheduled printing of a text file using batch files or schtasks
Most Xerox devices REQUIRE lp as the LPD printer name. -- Alan Morris Windows Printing Team Search the Microsoft Knowledge Base here: http://support.microsoft.com/search/?adv=1 This posting is provided "AS IS" with no warranties, and confers no rights. "Klaus Jorgensen" <kj@address.invalid> wrote in message news:%235bK3DFzIHA.5520@TK2MSFTNGP06.phx.gbl... > Gadgetman wrote: >> Klaus Jorgensen;3796335 Wrote: >>> Try redirecting the output of the lpr command to a log file: >>> lpr -S MyIP_address -P 8550dp blank.txt >lpr.log >> >> I've attempted to try your suggestion for redirecting the output of the >> lpr command to a log file. (The log file remains blank?) >> >> Question:could it be due to the raw file data being passed? >> Also: do you have an example of a known working batch file syntax for >> using the LPR command? > > If a log file is created and is empty, the lpr command is ok. > If the raw file is empty, the printer might probably just ignore the > file - try grab the output of a Windows test print to a test.prn and use > that file with the lpr command. > Also, the printer could be restrictive with the port name, try using lpt1, > lp1 or pr1 instead of 8550dp. If a printer server box (e.g. JetDirect) has > more than one port, the port name must specify the actual port, but with a > built-in network card in the printer, it shouldn't really matter. > > > /klaus > > |
|
#18
| |||
| |||
| Quote:
Well no success with lpt1, lp1 or pr1 However, I decided to go a different route to make the batch file work. SUCCESS!!!! I decided to use "SCHTASKS" to call a batch file named "WARMUP.BAT" BREAKDOWN OF METHOD USED: The command string I used for "SCHTASKS" was: SCHTASKS /CREATE /TN "PRINTER WARM UP" /TR C:\WARMUP.BAT /SC DAILY /ST 07:00:00 /ED 06/13/2009 /RU "username" /RP "password" The contents of my Batch file "WARMUP.BAT" was: NOTEPAD /P C:\PRINTER_WARM_UP.TXT Once I was able to make the batch file work on it's own, I knew it could work using "SCHTASKS" (As long as the batch file and text file were positioned on the system in the appropriate directory for "SCHTASKS" to correctly locate and execute.) Now I just need to figure out the correct syntax for executing the task everyday at 7am, and make it run every 239 minutes until 7pm (M-F if possible ?) Since the printer goes into power saving mode after 240 minutes. If I have to run it everyday of the week I don't mind, as long as I can get the above to work. I'm unable to use the suggested /RI for some reason, and find no reference to this command anywhere. (Typo perhaps?) Thanks for your continued help on this! Glenn |
|
#19
| |||
| |||
| Quote:
LP WORKED! I was able to make the batch file work, however; it will not run using "SCHTASKS" BUT! Better Yet! I was able to use the GUI version which does execute the LPR batch file, and it allowed me to utilize the advanced settings for executing all of my requirements: Start time: 7am, then run every 239 minutes, End at: 7pm You Guys ROCK! Thanks for all your help on this one! Hopefully someone else can utilize this method as well! |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "scheduled printing of a text file using batch files or schtasks" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DSMOD from batch and text file | Pete Jones | Active Directory | 3 | 04-03-2010 01:42 AM |
| batch file to split multiple text files in half. | yammyguy | Windows Server Help | 8 | 11-05-2009 07:19 PM |
| Problems running batch file as scheduled task | pete0085 | Windows Server Help | 7 | 01-01-2009 03:15 PM |
| Unable to start scheduled task after creating it with Schtasks | Flea# | Windows Server Help | 7 | 09-03-2008 06:56 AM |
| schtasks to call batch file. | am_shraddha | Software Development | 0 | 13-03-2007 08:22 PM |