Windows XP Community - XPHeads



scheduled printing of a text file using batch files

microsoft.public.windowsxp.print.fax


Reply
  #1 (permalink)  
Old 06-05-2008, 06:10 PM
Gadgetman
 
Posts: n/a
scheduled printing of a text file using batch files

I've been attempting to automate the process of printing a text file
using a batch file or schtasks in the command line, in order to provide
a "warm up" method (test page) for our networked Xerox printer.
The printer has issues with time outs, after 240 minutes of non use. It
then takes 30 seconds to 5 minutes (depending upon the settings in
place) for the printer to warm up, before it will print. I can
obviously use the software or hardware process to do such, but I have
better things to do with my time.

Printing from the command line using notepad works fine!

(Code String Example
notepad /p desktop\blank.txt


I am stumped on using the proper syntax method for the command line
when attempting to use the "schtasks" for automating this process.

(Code String EXAMPLE
schtasks /create /s /tn "Printer Warm Up" /tr notepad /p
desktop\blank.txt /sc daily /st 10:00:00 /ed 06/06/2008

I receive the following error:

ERROR: Invalid syntax. Value expected for '/s'



I've tried many different ways of moving the "/s" around to make this
work, but it always complains about the string in place.

Other ERROR: Cannot specify password without specifying the user name.

There should be an easier way to specify the local system, without user
name and password?

ANY IDEAS?
(Besides dumping the Xerox printer...LOL)


--
Gadgetman
------------------------------------------------------------------------
Gadgetman's Profile: http://forums.techarena.in/member.php?userid=51066
View this thread: http://forums.techarena.in/showthread.php?t=981521

http://forums.techarena.in

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-05-2008, 06:50 PM
Alan Morris [MSFT]
 
Posts: n/a
Re: scheduled printing of a text file using batch files
this would be a scheduled task question rather than a printing question. I
have never used the schtasks command. Unsure which newsgroup that would go
to.

--
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.

"Gadgetman" <Gadgetman.3ajnzd@DoNotSpam.com> wrote in message
news:Gadgetman.3ajnzd@DoNotSpam.com...
>
> I've been attempting to automate the process of printing a text file
> using a batch file or schtasks in the command line, in order to provide
> a "warm up" method (test page) for our networked Xerox printer.
> The printer has issues with time outs, after 240 minutes of non use. It
> then takes 30 seconds to 5 minutes (depending upon the settings in
> place) for the printer to warm up, before it will print. I can
> obviously use the software or hardware process to do such, but I have
> better things to do with my time.
>
> Printing from the command line using notepad works fine!
>
> (Code String Example
> notepad /p desktop\blank.txt
>
>
> I am stumped on using the proper syntax method for the command line
> when attempting to use the "schtasks" for automating this process.
>
> (Code String EXAMPLE
> schtasks /create /s /tn "Printer Warm Up" /tr notepad /p
> desktop\blank.txt /sc daily /st 10:00:00 /ed 06/06/2008
>
> I receive the following error:
>
> ERROR: Invalid syntax. Value expected for '/s'
>
>
>
> I've tried many different ways of moving the "/s" around to make this
> work, but it always complains about the string in place.
>
> Other ERROR: Cannot specify password without specifying the user name.
>
> There should be an easier way to specify the local system, without user
> name and password?
>
> ANY IDEAS?
> (Besides dumping the Xerox printer...LOL)
>
>
> --
> Gadgetman
> ------------------------------------------------------------------------
> Gadgetman's Profile: http://forums.techarena.in/member.php?userid=51066
> View this thread: http://forums.techarena.in/showthread.php?t=981521
>
> http://forums.techarena.in
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-06-2008, 06:13 PM
Hal Hostetler [MVP P/I]
 
Posts: n/a
Re: scheduled printing of a text file using batch files
Well, I'm no scheduled task expert, either, however, in looking at the
syntax for the schtasks command and the /S switch in particular, I read it
that, if you use this switch, you must provide a remote system argument for
it; your example has no remote system argument defined. If you leave the /S
out, help indicates the system parameter defaults to the local system. The
/P switch would probably require a /U username if used. It looks like using
/RP SYSTEM would run everything under the system account. If I get some
time, I'll play with this.

Hal
--
Hal Hostetler, CPBE -- hhh@kvoa.com
Senior Engineer/MIS -- MS MVP-Print/Imaging -- WA7BGX
http://www.kvoa.com -- "When News breaks, we fix it!"
KVOA Television, Tucson, AZ. NBC Channel 4
Live at Hot Licks - www.badnewsbluesband.com

"Gadgetman" <Gadgetman.3ajnzd@DoNotSpam.com> wrote in message
news:Gadgetman.3ajnzd@DoNotSpam.com...
>
> I've been attempting to automate the process of printing a text file
> using a batch file or schtasks in the command line, in order to provide
> a "warm up" method (test page) for our networked Xerox printer.
> The printer has issues with time outs, after 240 minutes of non use. It
> then takes 30 seconds to 5 minutes (depending upon the settings in
> place) for the printer to warm up, before it will print. I can
> obviously use the software or hardware process to do such, but I have
> better things to do with my time.
>
> Printing from the command line using notepad works fine!
>
> (Code String Example
> notepad /p desktop\blank.txt
>
>
> I am stumped on using the proper syntax method for the command line
> when attempting to use the "schtasks" for automating this process.
>
> (Code String EXAMPLE
> schtasks /create /s /tn "Printer Warm Up" /tr notepad /p
> desktop\blank.txt /sc daily /st 10:00:00 /ed 06/06/2008
>
> I receive the following error:
>
> ERROR: Invalid syntax. Value expected for '/s'
>
>
>
> I've tried many different ways of moving the "/s" around to make this
> work, but it always complains about the string in place.
>
> Other ERROR: Cannot specify password without specifying the user name.
>
> There should be an easier way to specify the local system, without user
> name and password?
>
> ANY IDEAS?
> (Besides dumping the Xerox printer...LOL)
>
>
> --
> Gadgetman
> ------------------------------------------------------------------------
> Gadgetman's Profile: http://forums.techarena.in/member.php?userid=51066
> View this thread: http://forums.techarena.in/showthread.php?t=981521
>
> http://forums.techarena.in
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-08-2008, 07:19 PM
nha@horten.dk
 
Posts: n/a
Re: scheduled printing of a text file using batch files
I get the /p to work for me - have a ssimilar problem with a Sharp
printer. However, does anyone know how to use the /p in addition with
a specified printer - I have 12 printer to wake up every morning

I have tried notepad.exe /p [printername] goodmorning.txt

with no result.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-09-2008, 03:03 PM
Klaus Jorgensen
 
Posts: n/a
Re: scheduled printing of a text file using batch files
nha@horten.dk wrote:
> I get the /p to work for me - have a ssimilar problem with a Sharp
> printer. However, does anyone know how to use the /p in addition with
> a specified printer - I have 12 printer to wake up every morning
>
> I have tried notepad.exe /p [printername] goodmorning.txt
>
> with no result.


If the printers are all non-GDI (e.g. PCL or PS), you can use the lpr
command to print directly to the printer via its ip address:
lpr -S ip_address -P lpt1 wakeup.txt

The wakeup.txt file could be created by printing to a file from e.g.
notepad.


/klaus


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 06-10-2008, 07:17 PM
Gadgetman
 
Posts: n/a
Re: scheduled printing of a text file using batch files or schtasks

(Code String Example
notepad /p desktop\blank.txt

In the above example, you should be able to print without specifying
anything else. (System, Printer, Username and Password shouldn't be
required.)

However, if you use "SCHTASKS" the "/P" takes on a whole new meaning.
("/P" would then indicate PASSWORD, and using "/P" switch would
probably require a /U username if used.)


--
Gadgetman
------------------------------------------------------------------------
Gadgetman's Profile: http://forums.techarena.in/member.php?userid=51066
View this thread: http://forums.techarena.in/showthread.php?t=981521

http://forums.techarena.in

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 06-10-2008, 07:33 PM
Gadgetman
 
Posts: n/a
Re: scheduled printing of a text file using batch files or schtasks

Klaus Jorgensen;3792031 Wrote:
> nha@horten.dk wrote:
> > I get the /p to work for me - have a ssimilar problem with a Sharp
> > printer. However, does anyone know how to use the /p in addition with
> > a specified printer - I have 12 printer to wake up every morning
> >
> > I have tried notepad.exe /p [printername] goodmorning.txt
> >
> > with no result.

>
> If the printers are all non-GDI (e.g. PCL or PS), you can use the lpr
> command to print directly to the printer via its ip address:
> lpr -S ip_address -P lpt1 wakeup.txt
>
> The wakeup.txt file could be created by printing to a file from e.g.
> notepad.
>
>
> /klaus

"lpr -S ip_address -P lpt1 wakeup.txt"

This works Great Also, and appears to be yet another way to print from
the command line. (Thanks for providing another way to do such, I'm
always learning! Appreciate your input!)

It's very similar to the original command used: notepad /p
desktop\blank.txt
(Which works fine if I manually type in the command)

Does anyone know how to apply this using "SCHTASKS" ?

Or possibly open my eyes to using a Batch File for the commands to run
at specific times?


I really appreciate all suggestions and efforts!

Thanks Again!


--
Gadgetman
------------------------------------------------------------------------
Gadgetman's Profile: http://forums.techarena.in/member.php?userid=51066
View this thread: http://forums.techarena.in/showthread.php?t=981521

http://forums.techarena.in

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 06-10-2008, 09:01 PM
Klaus Jorgensen
 
Posts: n/a
Re: scheduled printing of a text file using batch files or schtasks
Gadgetman wrote:
> "lpr -S ip_address -P lpt1 wakeup.txt"
>
> It's very similar to the original command used: notepad /p
> desktop\blank.txt
>

Yes, but that would require a printer driver - the lpr command sends a
raw file to the printer.

> Does anyone know how to apply this using "SCHTASKS" ?
>

Why not use the GUI to add the batch job?


/klaus


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 06-10-2008, 09:03 PM
Gadgetman
 
Posts: n/a
Re: scheduled printing of a text file using batch files or schtasks

Gadgetman;3794541 Wrote:
> "lpr -S ip_address -P lpt1 wakeup.txt"
>
> This works Great Also, and appears to be yet another way to print from
> the command line. (Thanks for providing another way to do such, I'm
> always learning! Appreciate your input!)
>
> It's very similar to the original command used: notepad /p
> desktop\blank.txt
> (Which works fine if I manually type in the command)
>
> Does anyone know how to apply this using "SCHTASKS" ?
>
> Or possibly open my eyes to using a Batch File for the commands to run
> at specific times?
>
>
> I really appreciate all suggestions and efforts!
>
> Thanks Again!

Another excellent result of using this command:
"lpr -S ip_address -P lpt1 wakeup.txt"
is that it spools the print job "blank.txt" without printing any actual
data!
(This means that we can re-use the paper, since it remains blank.)
Something I was unable to do using the previous command:
"notepad /p desktop\blank.txt"
(which always required some data within the text file, and also printed
"Page 1" at the bottom regardless.
Now if I can only figure out how to automate the process, so it will do
this every morning, and every 239 minutes until 7pm M-F!


--
Gadgetman
------------------------------------------------------------------------
Gadgetman's Profile: http://forums.techarena.in/member.php?userid=51066
View this thread: http://forums.techarena.in/showthread.php?t=981521

http://forums.techarena.in

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 06-10-2008, 10:42 PM
Gadgetman
 
Posts: n/a
Re: scheduled printing of a text file using batch files or schtasks

Klaus Jorgensen;3794684 Wrote:
> Gadgetman wrote:
> > "lpr -S ip_address -P lpt1 wakeup.txt"
> >
> > It's very similar to the original command used: notepad /p
> > desktop\blank.txt
> >

> Yes, but that would require a printer driver - the lpr command sends a
> raw file to the printer.
>
> > Does anyone know how to apply this using "SCHTASKS" ?
> >

> Why not use the GUI to add the batch job?
>
>
> /klaus

Funny you should mention that, as I'm attempting to create a working
batch file which will execute the command line:"lpr -S ip_address -P
lpt1 wakeup.txt"
using the GUI "Scheduled Tasks" within XP.
(If successful, it will most likely run using "AT" or "SCHTASKS" as
well.)

Just having trouble writing this Batch File (My first batch file) to
execute properly.
The batch file appears to run, but nothing occurs.

Yet typing: "lpr -S ip_address -P lpt1 wakeup.txt" in the command
manually, it executes flawlessly. (The printer spools!)

Any Ideas / Suggestions?


--
Gadgetman
------------------------------------------------------------------------
Gadgetman's Profile: http://forums.techarena.in/member.php?userid=51066
View this thread: http://forums.techarena.in/showthread.php?t=981521

http://forums.techarena.in

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:32 PM.


Registry Mechanic - Free Scan Now
Driver Scanner 2009 - Free Scan Now




Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74