Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

How do I automatically print a web page?


  • Please log in to reply
6 replies to this topic

#1 jzz6q1

jzz6q1

  • Members
  • 16 posts
  • OFFLINE
  •  
  • Local time:12:21 AM

Posted 22 November 2004 - 05:01 PM

Hi! I have a windows XP professional computer, and I have setup a scheduled task to bring up a specific web page every day at 6am. But I want to have the computer also send this output to my default printer without me clicking the printer icon. Anyone know how to do this? Thanks.

BC AdBot (Login to Remove)

 


#2 LoLucky

LoLucky

  • Members
  • 331 posts
  • OFFLINE
  •  
  • Local time:12:21 AM

Posted 23 November 2004 - 04:22 PM

Hi i don't know the exact answer but i can give some hints that maybe someone might understand what i mean

there might be a command line that could pipe "|" a webpage to print.exe/print.com/msprint.dll/msprint2.dll (not sure which if any at all)

Maybe phawgg can decipher what i'm saying (seems to be only one who can) =)

#3 JEservices

JEservices

    helping hand


  • Members
  • 1,700 posts
  • OFFLINE
  •  
  • Location:Texas
  • Local time:10:21 PM

Posted 23 November 2004 - 06:02 PM

It may be done with a MS-DOS batch file, then have the file run as a scheduled task, at the interval that you want.

I am running a few tests as we speak on the exact coding for it. It will be small enough that you can copy and paste. The exact directions will accompany the code.
We are all curious like a cat. We wonder, we ask, we learn.
Please post back when a suggestion works, so that others may learn.

#4 jzz6q1

jzz6q1
  • Topic Starter

  • Members
  • 16 posts
  • OFFLINE
  •  
  • Local time:12:21 AM

Posted 29 November 2004 - 12:02 PM

Jason of JE Services:

I am encouraged that you are doing some testing, and I have been waiting patiently for you to reply once again with the code which you indicated you would provide. Hope all is going well and you can provide the solution soon!

#5 JEservices

JEservices

    helping hand


  • Members
  • 1,700 posts
  • OFFLINE
  •  
  • Location:Texas
  • Local time:10:21 PM

Posted 29 November 2004 - 03:03 PM

This is a long detailed process, so if you have any questions, do not hesitate to ask, ok?

There are many different issues that you have to deal with to get a scheduled task to print to a USB printer. There may be different ways to do it, but the portion that I have figured out was to use MS-DOS. As most people realize, DOS does not like USB printers, but that is ok.

Configuring DOS to recognize a USB printer:

In order to get DOS to print to a USB printer, you have to share your printer with a LPT port. Chances are, you do not have anything hooked to one, because it is used for older printers. To get your printer to be shared with both USB and a LPT port, do the following steps:
  • Open up your Printer preferences: START -> Control Panel -> double-click Printers and faxes -> right-click on your printer, and chose preferences.
  • Click the Sharing tab
  • Click Share this printer, and in the share name type a short name (ex: C64), and click apply
  • Exit your printer properties window
  • Open System Properties by double-click System on the Control Panel window
  • Click the Computer Name tab, and write down the full computer name (to be used later).
  • Open a DOS window by clicking START -> run -> type cmd in the open box, and click OK
  • Type the code below, where full computer name, is your full computer name and C64 is what you called your printer
  • You will see a confirmation dialog saying 'The command has completed successfully'
  • Close the DOS window
net use LPT1  \\full computer name\C64 /persistent:yes



Yes, it is alot of information so far, but you have made it through the first part. You know what they say about a long journey-they all start with the first step :flowers:


Now that you have configured DOS to use your USB printer, it is time for DOS to do something with it. For now, I would like for you to do a test print. Right-click anywhere on your desktop, and select new -> text document. Enter the text in the code below and click File -> Save as. Change the location to Desktop, save as type to all files, and in the file name field, type print.bat and finally click save. You will see that the icon kinda looks like a gear in a window :thumbsup: . Put some paper in, and double click the file, to see that it has printed to your printer. You do not have to finish the print job, just so long as it prints something.

@echo off

dir c: /s>LPT1


Now for the really, really fun part. As you may have guessed, DOS does not like any files that requires Windows to run, such as IE. The reason is because DOS is text based, and nearly everying in Windows is graphic based. As much as I would hate to leave you with this, I have not figured out a way to combine the Scheduled Task of Windows, with the (now) DOS-based redirected USB -> LPT port. I am working on it though. I was hoping that I could go the direction as using Scheduled task to open up IE-to a specific webpage, and then a DOS batch program to print what is on the screen. So far, I have not been successful, unless someone knows the coding to get DOS to Print screen...?
We are all curious like a cat. We wonder, we ask, we learn.
Please post back when a suggestion works, so that others may learn.

#6 jzz6q1

jzz6q1
  • Topic Starter

  • Members
  • 16 posts
  • OFFLINE
  •  
  • Local time:12:21 AM

Posted 01 December 2004 - 05:04 PM

JE Services:

Thanks for all you have done so far. I was thinking that all we have to do is to tell IE to print to the default printer, but if we are trying to invoke this in DOS, then of course we have to point to the printer by setting up a net use LPT1 command.

The printer in this case is not a USB printer, but it is a networked printer (which means it would have an IP address). So I don't think I should try sharing a networked printer (it already IS shared by definition). Or am I being too cautious?

If you get the rest of the solution, let me know. Thanks!

#7 JEservices

JEservices

    helping hand


  • Members
  • 1,700 posts
  • OFFLINE
  •  
  • Location:Texas
  • Local time:10:21 PM

Posted 10 December 2004 - 03:23 PM

Being a networked printer throws me a loop. I am not familiar with how DOS uses networks, in this case, a printer.

Im sorry that I can not be much more help to you. I will be posting this in other message boards to see if an answer comes up.
We are all curious like a cat. We wonder, we ask, we learn.
Please post back when a suggestion works, so that others may learn.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users