+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 18
Windows Thread, Scheduling a webpage print task in Technical; Our school's notices take the form of a web-page which is printed every morning and circulated in registers. Does anyone ...
  1. #1
    u8dmtm's Avatar
    Join Date
    Feb 2006
    Posts
    231
    Thank Post
    7
    Thanked 13 Times in 12 Posts
    Rep Power
    20

    Scheduling a webpage print task

    Our school's notices take the form of a web-page which is printed every morning and circulated in registers. Does anyone know how I can schedule the particular web-page to be printed every day at a given time automatically so that a nice big pile of notices is sitting waiting for collection from a printer first thing each morning?

    Since this would be unattended obviously any solution must not require user input.

  2. #2

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,258
    Thank Post
    671
    Thanked 1,644 Times in 1,466 Posts
    Rep Power
    424

    Re: Scheduling a webpage print task

    How about:

    Code:
    Option Explicit
    Dim objShell
    Set objShell = CreateObject("WScript.Shell")
    objShell.Run "c:\temp\test.htm" 
    Wscript.Sleep 1000
    objShell.SendKeys "^p" 
    WScript.Sleep 1000
    objShell.SendKeys "{tab}"
    WScript.Sleep 300
    objShell.SendKeys "p"
    WScript.Sleep 1000
    objShell.SendKeys "%"
    WScript.Sleep 100
    objShell.SendKeys "f"
    WScript.Sleep 100
    objShell.SendKeys "c"
    WScript.Quit
    Just change the filename to the html file you wish to open.

    Ben

  3. #3

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,828
    Thank Post
    3,340
    Thanked 1,057 Times in 978 Posts
    Rep Power
    365

    Re: Scheduling a webpage print task

    Quote Originally Posted by plexer
    How about:

    Code:
    Option Explicit
    Dim objShell
    Set objShell = CreateObject("WScript.Shell")
    objShell.Run "c:\temp\test.htm" 
    Wscript.Sleep 1000
    objShell.SendKeys "^p" 
    WScript.Sleep 1000
    objShell.SendKeys "{tab}"
    WScript.Sleep 300
    objShell.SendKeys "p"
    WScript.Sleep 1000
    objShell.SendKeys "%"
    WScript.Sleep 100
    objShell.SendKeys "f"
    WScript.Sleep 100
    objShell.SendKeys "c"
    WScript.Quit
    Just change the filename to the html file you wish to open.

    Ben
    Couldnt you simplify it and just use this from the site below :

    http://sastools.com/b2/post/79393894

    But use it in a vbscript and just use windows scheduling ( http://www.iopus.com/guides/winscheduler.htm ) to assign the vbscript to execute that each morning

    Sendkeys is a bit dangerous considering that you have to ensure that the app or file you need to do things on has to be in focus otherwise you will end up doing other things.

  4. #4
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,987
    Thank Post
    120
    Thanked 283 Times in 261 Posts
    Rep Power
    107

    Re: Scheduling a webpage print task

    AutoIt us bette for sending keys and making sure windows are active etc.

  5. #5

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,258
    Thank Post
    671
    Thanked 1,644 Times in 1,466 Posts
    Rep Power
    424

    Re: Scheduling a webpage print task

    Code:
    Option Explicit
    Dim objShell
    Set objShell = CreateObject("WScript.Shell")
    objShell.Run "rundll32.exe mshtml.dll,PrintHTML test.html"
    WScript.Quit
    Then.

    Ben

  6. #6
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,987
    Thank Post
    120
    Thanked 283 Times in 261 Posts
    Rep Power
    107

    Re: Scheduling a webpage print task

    Or you could just cut that down to one line with a batch script...... :P nah I'm joking VBS always behaves nicer in most circumstances.

  7. #7

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,408
    Thank Post
    640
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    326

    Re: Scheduling a webpage print task

    Or schedule rundll32.exe to run with the parameters mshtml.dll,PrintHTML test.html ... 8)

  8. #8

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,258
    Thank Post
    671
    Thanked 1,644 Times in 1,466 Posts
    Rep Power
    424

    Re: Scheduling a webpage print task

    That'd do it as well.

    I'm going to give up I think.

    Ben

  9. #9

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,408
    Thank Post
    640
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    326

    Re: Scheduling a webpage print task

    I take it somebody's had their head buried in a VBScript help file/manual all day then Ben?

  10. #10

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,258
    Thank Post
    671
    Thanked 1,644 Times in 1,466 Posts
    Rep Power
    424

    Re: Scheduling a webpage print task

    Not really no just been looking at stuff throughout the day I tested my senkeys one and it worked ok but there are other ways too.

    Ben

  11. #11

    Join Date
    Feb 2006
    Posts
    1,187
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: Scheduling a webpage print task

    Quote Originally Posted by webman
    Or schedule rundll32.exe to run with the parameters mshtml.dll,PrintHTML test.html ... 8)
    I see you brought your razor Mr. Occam

  12. #12

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,408
    Thank Post
    640
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    326

    Re: Scheduling a webpage print task

    Why yes... yes I did

  13. #13
    u8dmtm's Avatar
    Join Date
    Feb 2006
    Posts
    231
    Thank Post
    7
    Thanked 13 Times in 12 Posts
    Rep Power
    20

    Re: Scheduling a webpage print task

    Thanks for all those sugestions, its working fine now.

  14. #14

    Join Date
    Mar 2006
    Posts
    537
    Thank Post
    2
    Thanked 3 Times in 2 Posts
    Rep Power
    19

    Re: Scheduling a webpage print task

    Quote Originally Posted by NetworkGeezer
    I see you brought your razor Mr. Occam
    As this is EduGeek that should be
    I see you brought your iron Mr. Sheppard

  15. #15

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,408
    Thank Post
    640
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    326

    Re: Scheduling a webpage print task

    I'm getting board of all these ironing jokes now :?

    Sorry 8)

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Design - Best Webpage you have ever seen?
    By Zoom7000 in forum General Chat
    Replies: 26
    Last Post: 4th June 2008, 12:03 PM
  2. Replies: 7
    Last Post: 22nd October 2007, 10:05 PM
  3. Print Spooler on Print Server
    By drewinc in forum Windows
    Replies: 8
    Last Post: 22nd May 2007, 09:02 AM
  4. Project scheduling for windows
    By timbo343 in forum Windows
    Replies: 1
    Last Post: 8th February 2007, 10:34 AM
  5. Scheduling Ejecting The Tapes
    By Mintsoft in forum Windows
    Replies: 9
    Last Post: 9th March 2006, 11:44 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •