so is there then another way of automatically printing HTML files?
Main Topics
Browse All TopicsHi,
I have a bat that is run whenever an html file is created in a directory and prints it.
The problem is that whenever it prints, it pops up a dialog that asks what printer to use.
How can I stop this dialog box from showing? I need them to printo without intervention.
Steven
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I am going to look for a better solution, which I feel is out there, but you can do this with ...
Notepad /p filename.txt
With that command it will print, without prompting, the file called filename.txt. Notepad does open briefly but is quickly closed. Let me know how this works and I will post if I can find a better option.
bol
It looks like there is a method to print without dialog at http://www.robvanderwoude.
Let us know how that helps or if you have a question about using it.
bol
When I tried something like this a few years ago, I finally had to resort to invoking Netscape for each .html file. Back then, there was a command-line flag that would allow Netscape to print without popping up the print dialog.
If I was doing it again today, I would probably look at keystroke macro scripts, such as AutoHotKey, to simply push the buttons on the unavoidable dialogs. That seems to be the approach in Rob van der Woude's batch programs, mentioned above.
Bly te kenne, Stevie, hoe gaan dit met u?
Ek sal my bes doen om jou to help.
Another idea along the same lines as AutoHotKey would be AutoIT:
http://www.autoitscript.co
You have a user interface that helps you create the script as you go through the File > Print dialogs and select the printer. Say for example that the first part of the batch file just creates a temporary copy of the newly created *.htm file to a file of the same name each time.
You seem to already have a variable for the target file in place, so just create another (say %NEWFILE%) for the path to the new file name (say Temp_Print.htm).
Create the AutoIT Script to open that renamed temporary *.htm file and do a File > Print, then close the file. This will allow you to create a universal *.exe file that can be called from a batch file. I've used the name PrintHTM.exe in the example below:
@echo off
copy "%WD_FILE%" "%NEWFILE%"
start /b /wait PrintHTM.exe
del "%NEWFILE%" > nul
exit
Rob van der Woude's solution (as suggested earlier) is a good one if you really don't want to have to use any third party programs.
Alles van die beste. Tot siens.
Bill
Hi.
I think http://www.robvanderwoude.
I use WatchDirectory to launch the bat and pass it the variables, if the document can be converted to PDF or to tiff without intervention, it will print fine also.
BTW.
How did you know I can speak Afrikaans?
Steven
Hi Steven
Your question shows your time zone, and the dee Hook sounded like a play on Afrikaans "de Hoek", like Windhoek. I learned Afrikaans for 2 years at secondary school in Rhodesia (now your ill-fated border country Zimbabwe).
There are a number of pdf "printers" that will print open documents of most types to *.pdf files, and the command line switch /p normally prints to the default printer eg. the free Foxit PDF Reader would probably accept:
foxit.exe e:\path-to\doc.pdf /p
I would have to try.
So, I suppose it depends on whether the PDF conversion virtual printer would accept a call to convert a named document from the command line, preferably without opening it. Most tend to work by a process similar to a PrintScreen command, although the whole document is converted rather than just visible screen area, but the document has to actually be opened for that.
I use an old version of Broadgun pdfMachine for that type of thing, but it's basic and was very much cheaper than its most recent version. I'm pretty sure there will be Open Source alternatives that might work from the command line without opening the target file, but I haven't tested any.
Cheers
Willem :-)
ah - lol.
I have lots of "Rhodesian" friends - people too attached to the old way to aknowledge the new government.
Watch Directory will print the PDFs for me... (using acrobat reader) no problem - I use it to print all our job tickets and delivery notes. it's just a pain that for HTML pops up that stupid window.
So if I could convert to PDF (or even tiff) in the background - it would be fine.
Thanks for the help and advice!
Steven
Business Accounts
Answer for Membership
by: WanaBRichPosted on 2008-08-25 at 03:16:58ID: 22304333
You can not do this as it a windows fuction.