IOException while print in windows 98

Hi all,
While printing,i get the IOEXception
java.io.IOException: CreateProcess: C:\\command /c copy c:\CashPrintPage.txt lpt1 error=2
�at java.lang.ProcessImpl.create(Native Method)
�at java.lang.ProcessImpl.<init>(Unknown Source)
�at java.lang.ProcessImpl.start(Unknown Source)
�at java.lang.ProcessBuilder.start(Unknown Source)
�at java.lang.Runtime.exec(Unknown Source)
�at java.lang.Runtime.exec(Unknown Source)
�at com.leaps.core.LeapsFileDownload.printFile(LeapsFileDownload.java:85)
�at com.leaps.core.LeapsFileDownload.init(LeapsFileDownload.java:24)
�at sun.applet.AppletPanel.run(Unknown Source)
�at java.lang.Thread.run(Unknown Source)
The Code is:
public void printFile(String fileName) {
          String strCmd="";
          if(System.getProperty("os.name").equalsIgnoreCase("Windows 98"))
          strCmd = "C:\\command";
          else
strCmd = "cmd";
String []cmd=new String[5];
cmd[0]=strCmd;
cmd [1]="/c";
cmd [2]="copy";
cmd[3]=fileName;
cmd[4]="lpt1";
try {
Process child=Runtime.getRuntime().exec(cmd);// error is shown in this line
} catch (IOException ex) {
ex.printStackTrace();
Message was edited by:
finraja

hi,
you have to leave one space after "/c " & "copy " & before newfilename " lpt1"
here your modified code
import java.io.*;
public class cmd
public static void main (String args[])
String strCmd="";
if(System.getProperty("os.name").equalsIgnoreCase("Windows 98"))
strCmd = "C:\\command";
else
strCmd = "cmd";
String []cmd=new String[5];
cmd[0]=strCmd;
cmd [1]=" ";
cmd [2]="copy ";
cmd[3]=args[0];
cmd[4]=" newfilename";
try {
Process child=Runtime.getRuntime().exec(cmd);// error is shown in this line
child.wait();
System.out.println(cmd[0]+cmd[1]+cmd[2]+cmd[3]+cmd[4]);
System.out.println("1 files copied");
catch (Exception ex) {
ex.printStackTrace();
}

Similar Messages

  • Event ID : 372 Print Service message while printing on Windows 8

    I get meaningless error message on Windows 8 after every application print job with HP Laserjet P1606dn. The Win 8 popup error msg says "Error Printing on HP Laserjet Professional...The Printer Couldn't Print .....". The corresponding Event Manager error is:
    "Event 372, Print Service
    The document Print Document, owned by Mark, failed to print on printer HP LaserJet Professional P1606dn. Try to print the document again, or restart the print spooler.
    Data type: RAW. Size of the spool file in bytes: 312352. Number of bytes printed: 312352. Total number of pages in the document: 1. Number of pages printed: 0. Client computer: \\DELLW. Win32 error code returned by the print processor: 0. The operation completed successfully."
    The print job then prints perfectly.
    Historically, my Event Viewer shows these errors in clusters. This cluster began on 8/25/2013, the same day I replaced my network router with a Frontier Netgear Model B90-755044-15 Rev 3. I assigned a new static IP address to the printer after the router replacement, and uninstalled / reinstalled the printer on each machine so they would recognize the new IP address. I also updated the printer's firmware from version datecode 20120130 to 20130703 at that time (in retrospect, I should never have updated firmware on same day as the network changes). Errors have appeared ever since. Updating the software driver version from 20100406 to 20120926 today did not fix the problem.
    The previous Event 372 cluster was limited to a single day, 2/9/2013. I don't see any obvious print-related errors on 2/9 except about ten 372s scattered through the day and two 823s preceding the 372s (823 is informational and says I changed default printer).
    A shared (USB connected to one pc) HP Photosmart printer never generates these errors.
    The same Laserjet P1606dn printer is accessed by three different Win 8 machines over wired (1 pc) and wireless (2 pcs) network connections, and all three now get the same annoying and misleading error message even though their print jobs print perfectly.
     Also, installing Full Solution driver (instead of Basic driver) did not fix it.  Disabling Kaspersky firewall did not fix it.
    Exception:  when configuration page is printed from the Control Panel > Devices and Printers printer icon > Printing preferences... > Services tab > Print information pages, then the error message does NOT appear.  Error only appears when printing from common applications (Word, etc.).

    Can an HP expert please comment on this thread, including the link given in previous post to Windows 7 Forums?
    Is anything lost by disabling bidirectional communications for my HP Laserjet P1606dn in order to eliminate spurious error messages?
    Is there a bug in the HP driver causing this error?
    Is bi-directional communications a separate communications interface which should simply be ignored and unchecked when using wired ethernet or wireless communications?

  • Problem while printing 132 col. report....

    We have one report of width 132 columns. But when we print this report,
    it prints only upto half width (Approx. upto 70 characters.)
    We are using Reports 6i on Red Hat Linux server.
    I tried to modify report width at developing time. But it is of no
    use.
    Which parameters needs to be changed to solve this problem?
    Thanks...
    Kiran.

    Hello Abid,
    I tried as you suggested. But problem is not solved.
    But when I run this report in Windows environment, it prints ok. i.e. I am getting full width of report. What I notice here that while printing thru Windows, I am geeting 'US STD FANFOLD' paper size . But in Red Hat Linux (Advanced Sever 2.1) I am not getting this page size. SO I think if I have this page size in Red Hat then my problem may get solved. Have you any idea how can we get this page size in Red Hat ?
    Thanks.... Kiran

  • Error While Printing the Report

    Post Author: saqib
    CA Forum: .NET
    HI All,I have joined this forum recently. I found this forum so helpful. I have one query which is: I am using crystal report 10 with Dot Net 1.1, I have created one web report which consists of 19 pages. Once i press the print button on the report after previewing it shows me the error reporting screen of windows. I have checked in event viewer it gives me the following error detail:The description for Event ID ( 1000 ) in Source ( Microsoft Internet Explorer ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. The following information is part of the event: iexplore.exe, 6.0.2800.1106, printcontrol.dll, 10.0.0.533, 0003bb45. Can any one helps me as i am totally stuck in that. Thanks in advance.  

    Try the following if your printer is a network printer
    1. Add Printers - select Local Printer
    2. In the Add Printer wizard, select "create a new port" option and select "TCP/IP" as type
    3. Write the IP address of the network printer in the "Add standard TCP/IP Printer Port wizard". The port name becomes IP_<ip addr>. Click Next.
    4. Select the printer and printer type in "Add Printer" wizard.
    5. Select a driver and Write a printer name. This completes the setup. Use this printer name to print from Oracle reports.
    Hope this helps..
    Yogesh
    I am getting this error message while printing the report on Network Printer.
    "REP-1849: Failed while printing"
    Reports Server is not installed on my machine.
    On shared printer, it has no problems.
    Platform is Win2000. Report Builder 6.0.8.11.3
    Plz help !
    Thanks in advance !

  • Slow system while printing PDF's

    when printing PDF's to any of several printers (letter or tabloid sizes)the system response slows to an unbearable crawl lots of spinning beach balls come and go. the only system function that does not appear to be affected is the mouse movement, mouse clicks however are affected. I can't even change windows let alone apps without multiple minutes of delayed reactions. I used activity monitor to find "PrintJobMgr" seems to be using up to 100% of cpu resources and over 1GB of virtual memory at some times during the print process. I understand that PDF's are slow to print but that is not my problem as the print speed seems okay, just while printing I can't do anything else.
    Can anyone help or have same experience?

    What happens if you drag several PDFs right to the Printer's Icon or Printers Window without using Acrobat?
    At this point I think you should get Applejack...
    http://www.versiontracker.com/dyn/moreinfo/macosx/19596
    After installing, reboot holding down CMD+s, (+s), then when the DOS like prompt shows, type in...
    applejack AUTO
    Then let it do all 5 of it's things.
    At least it'll eliminate some questions if it doesn't fix it.
    The 5 things it does are...
    Correct any Disk problems.
    Repair Permissions.
    Clear out Cache Files.
    Repair/check several plist files.
    Dump the VM files for a fresh start.
    First reboot will be slower, sometimes 2 or 3 restarts will be required for full benefit... my guess is files relying upon other files relying upon other files!
    Disconnect the USB cable from any UPS so the system doesn't shut down in the middle of the process.

  • Error while printing invoice

    hi sapiens,
            the following error happens while printing my form from vf02.i have edited standard script rvinvoice01.i have not deleted any window.i have not even deleted text elemnts from the main window. what could be the problem .
    cancel error.
    Element ITEM_LINE window MAIN is not defined for zinvoice.
    thanks
    mani

    Hi
    The first thing: <b>the print doesn't depend on logon language <u>but customer language</u></b>.
    So u can logon with the language you prefer, that's no problem on logon langauge.
    Run trx SE71:
    - Insert the name of the sapscript
    - Insert the language of the version u need to correct
    - Go to the MAIN
    - Insert the text element is missing
    U have to do the above step for every version of your sapscript.
    Max
    Message was edited by:
            max bianchi

  • Error while printing smartforms

    Hi Friends,
      I am getting error "<b>Invalid value for parameter ARCHDEST</b>" while printing smartforms. This is happening only in IDES server. In Development the same smartform is working normally. I have checked in transaction SU53, to see whether all the authorisations have been given for IDES server. There is no problem in authorisation also. So what might be the reason for this. Please give me the solution to solve this problem.
    Thanks & Regards,
    Ranjith

    Hi Beginner,
    In the layout you have taken window or layout taken the big width in that case only you will get this type error syntatically it shows correct when you exicute the smart from try to give the print or see the print preview you will get this error (suggestion is better to check the window sizes)
    Thanks
    Ashok

  • HP Laserjet pro mfp m125nw not printing on windows 7

    I have attempting to install this printer on my Windows 7 PC both as a wireless printer and as a straight USB connection .
    with wireless turned off.
    Although the implementation always appears to execute successfully I am not able to print from the PC.
    No errors are displayed and when doing a test print the print output appears for a split second in the printer's print queue and almost immediately is deleted and disappears.
    I have turned the firewalls off (Norton 360 and Windows Defender) while doing all this but still no success.
    I have run a variety of printer diagnostics (Windows Fixit, HP Print and Scan Doctor) and they all indicate everything is setup correctly.
    I then attempted to install on a 2nd PC with Windows 8. This successfully installed 1st time and have now installed both as a wireless networked printer and as a USB standalone connection and everything works fine without any problems.
    I don't understand why I can't successfully install on my PC with Windows 7 - in particular as a standalone USB connection.
    Any ideas where I'm going wrong?

    Hi @DavidJS ,
    I see that you are experiencing issues printing from the Windows 7 computer over a wireless connection and USB connection, but the Windows 8 computer is working. I would really like to be able to help you resolve this issue.
    Clear the Spool folder and restart the Print Spooler.  How to Clear Current Print Queue In Windows Vista & Windows 7.
    Try printing again.
    Try these steps for printing over the wireless network.
    I would power cycle everything.
    Turn the printer and computer off.
    Disconnect the power cable on the router for 10 seconds, then reconnect the power cable again.
    Turn the computer on, then the printer.
    Make sure the printer is connected directly to a wall outlet. (don't use a power hub or a surge protector) This ensures the printer is receiving full power and may help this situation.
    Print out a configuration page to find out what the printer's IPv4 address is.
    Check the port showing on the computer, to make sure it matches.
    From Devices and Printers, right click the printer and left click Printer Properties, select the Ports tab.
    Click on configure port to view the IP address.
    If the IP address doesn't match then create a new port with the new IP address.
    Close the configure port window.
    Click Add Port, select Standard TCP/IP Port, then select New Port and follow the wizard.
    Type in the proper IP address for the printer.
    Make sure the printer is online.
    Test the printer.
    If you need further assistance, just let me know.
    Have a great day!
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • Can't print from Windows to Mac

    I've always had trouble printing to a printer attached to my Mac from Windows. Bonjour used to see the printer, but I could only occasionally actually print. For a while everything but PDFs worked, then even text stopped. As a last resort I tried the "reset printing system" option in System Preferences and then re-added the printer, but now Bonjour doesn't see it at all. I can browse to it via SMB at \\macname\printername, but all I can do is print a test page as Administrator. Regular print jobs and non-admin test pages just disappear - not in the queue on either client or server. Setting it up as an IPP printer instead didn't help.
    I'm at the end of my rope here, and any troubleshooting tips are welcome. I'm an IT guy, so technical details are very welcome: TCP ports to check for listeners on, services to look for, registry settings on the Windows end, anything.
    Details:
    Server:
    Mac OS X 10.6.2
    HP Photosmart D7560 printer connected via USB using HP Photosmart driver
    Clients:
    Windows XP, Windows Vista (32-bit), Windows 7 (32-bit and 64-bit)
    All on the same LAN (wireless), no trouble with TCP/IP connectivity (can ssh into the Mac from the Windows boxes, etc). Both Windows Firewall and UAC are turned off on the Vista/7 boxes, guest access is enabled on the Mac in Sharing preferences...
    Any help welcome.
    Thanks!

    I followed the instructions at http://www.ifelix.co.uk/tech/3012.html and am having the same issue. Whether setting up manually or using Bonjour, it seems that you have to select an Apple Driver. The problem is that the Windows 7 does not provide Apple drivers. Luckily, I have an old XP installation CD so I can access the printer drivers I need, but because I already installed the printer drivers from my printers CD Windows will automatically install with that driver, not giving me the "have disk" option.
    So I tried to install with Bonjour again, which allowed me to pull up the drivers from teh XP installation disk, but then gave me an error that I didn't have permissions to install the selected printer.
    So I deleted the Canon driver for my printer from Windows 7 and went through the process described at http://www.ifelix.co.uk/tech/3012.html again. This time I was able to select the Apple Color Laserwriter printer from the XP installation CD, but I got an error message saying that Windows was unable to find an appropriate driver.
    At this point, after a couple hours trying to do a simple file share, which should only take 30 seconds, I'm giving up being able to print to a printer connected to a mac from my Windows 7 laptop. Now I have to open files on the mac from the network file share to print.
    Mixed having both Macs and Windows machines on the same network is a recipe for a headache.

  • HP Officejet Pro 8610 bought 2 weeks ago. giving vertical lines while printing.

    Dear Sir,
    I bought new officejet pro8610 . 2 weeks ago. its giving vertical lines on printing any document from printer. scanner is absolutely fine just problem while printing and copying. i clear printhead few times. 
    i just check that when i am printing any paper from windows photo viewer,there are lines like this.
    but when i copy the same image in Ms Word 2007 and print it from there. the paper is clean without lines. its strange. while i have anyother printer HP Laserjet Color CP1025 attached with same computer . i print the same image from CP1025 from Windows Photo viewer, its clean from there without lines. can any one help me out from this issue

    Dear Sir,
    I bought new officejet pro8610 . 2 weeks ago. its giving vertical lines on printing any document from printer. scanner is absolutely fine just problem while printing and copying. i clear printhead few times. 
    i just check that when i am printing any paper from windows photo viewer,there are lines like this.
    but when i copy the same image in Ms Word 2007 and print it from there. the paper is clean without lines. its strange. while i have anyother printer HP Laserjet Color CP1025 attached with same computer . i print the same image from CP1025 from Windows Photo viewer, its clean from there without lines. can any one help me out from this issue

  • Cannot print to a shared printer on Windows

    Hello,
    I am a new user to Mac OS. Since ive bought it, about 2-3 months id say, im unable to print to a shared printer (via LAN) from my MBP. I have tried a lot of things and even tried Apple Support in my city (which isnt any good) and Printer Company support (Canon), they both are blaming on each other. Leaving my problem unsolved.
    Here is the set up:
    Win XP PC
    Mac  OS X 10.6 MBP
    2 Printers;
    1. Canon LBP 2900
    2. Canon MF4350d
    both shared over LAN to other PCs.
    Basically, Id like to ask a few question I think might help me.
    1. What kind of driver should i use while printing ? Im using the Generic one. I tried printing with 4350d driver, didnt help either. No driver available for LBP2900.
    2. Do i need to make any settings on my Win XP or Mac OS X ?
    any help would be appreciated. as this is really getting under my skin.
    Thanks.
    -Raghav

    I didnt mean to upset anyone. Its really cute to see every MAC person getting so upset even with the slightest negative comment for Apple. .
    See as far as I am concerend I perceive this problem as a MAC related problem. Because my other Windows PCs arent having the same issue. I know MAC has some advantages over Win, Im not debating that.
    Try to look at it from my perspective. I have used windows for about 12-15 years untill I got my MBP a few months back. The reason why I chose MBP was because I was impressed with what Apple did with iPhone 4 so I thought I should try an OS which is so hyped to be better than Windows. Truth is I am having a lot of problems with it.
    1. Compatiblity is a major issue. Maybe not in North America. But I am from a small place in India. Printers, websites, etc.
    2. Support/Service is pathetic. No ones knows whats going on. They are blaming each other (Apple & Canon)
    3. It really over heats ! upto 80 Degrees C ! I always heard MBs are super cool and all that. Truth is I cant use it on my bare lap. Whereas I got a HP Notebook at least 5 years old that hears up less than my MBP.
    4. Resoltion is so high I cant read text properly. OS X isnt a resolution independent OS, unlike Win.
    These are just few. I am not saying Im competely unsatisfied with the product. I do like its style. Its battery performance. Keyboard. Trackpad.
    But If an average consumer gets irritated in day to day tasks, then that OS isnt for the majority out there. Thats all I am saying. I have to look up for so many tweaks into Mac OS to make up for some basic things that Win has over Mac.
    Anyways, dont get offended. nothing against you. ITs just im not a fan of Apple. If  could Id return my MBP, but I cant so. Here I am

  • Scanning with an HP 3390 all-in one laser jet printer using Windows 7 pro (64 bit)

    I have recently acquired a Dell Windows 7 Pro (64 bit) OS computer and was wanting to use my HP all-in-one laser jet 3390 printer and scanner. The printer software which came with my HP 3390 will work with my Wind 7 Pro OS computer, however my HP 3390 scanner function will not work using this HP driver software, with my Win 7 Pro OS.  I am trying to locate the appropriate HP scanner and/or different printer drivers that will support both the printer AND scanner functions of my HP 3390 printer/scanner, while using my Windows 7 Pro OS computer.  Within the HP website, I have not been able to find this type of driver software or support, as least listed as such?  I was wondering, if there are maybe no dedicated or described scanner drivers for my situation, is there even another set of drivers which might be intended for other Window 7 Pro OS based computers and other HP printer/scanners, which would work for my situation as well?  Does anyone have a solution to resolve this issue via HP driver software or by another method...maybe even 3rd party?  Ther has to be a solution?

    @ccan 
    ‎Thank you for using HP Support Forum. I have brought your issue to the appropriate team within HP. They will likely request information from you in order to look up your case details or product serial number. Please look for a private message from an identified HP contact. Additionally, keep in mind not to publicly post ( serial numbers and case details).
    If you are unfamiliar with the Forum's private messaging please click here to learn more.
    Thank you,
    Omar
    I Work for HP

  • Why do I get a Fax prompt window when I try to print from Windows Photo Gallery?

    Trying to print photos from Windows Photo Gallery.  Print job looks as if it goes to the queue, but does not actually print.  Fax prompt window pops up as if I were preparing to fax.  Do I now have to disable the fax in order to print photos?  I take phone calls and faxes on the same phone line.

    1: I am sorry about the inconvinience. 
    The reason you find a check mark on a printer icon is to indicate that its a default printer. If the fax icon has a check mark, everytime you print a fax template will come up. 
    SOlution: Just right click on the other icon and select it as the default printer.
    2: Black lines while printing photos.
    CLick on the link below and check if the solution helps you.
    http://h10025.www1.hp.com/ewfrf/wc/document?cc=us&​lc=en&dlc=en&docname=c01957673
    Say "Thanks" by clicking the Kudos Star in the post that helped you.
    Please mark the post that solves your problem as "Accepted Solution"
    (Although I am employed by HP, I am speaking for myself and not for HP)

  • System crash while printing to Acrobat printer

    This is something that has annoyed me for a long time, sometimes while printing to Acrobat (making a PDF), the computer hangs and I have to turn the power off on the computer to shut down. I had this issue with version 7 and when I updated to version 9 the problem seem to go away. Now the PDFs that version 7 crashed on, version 9 wasn't. Tonight that all changed version 7 and 9 are hanging on certain web pages.
    The question, is this a problem that's a setting issue or an Acrobat bug or a Windows issue or an explorer issue?
    BTW this is a recently installed XP SP3 machine with only Adobe CS4 and Office 2007 on it, nothing else.
    Joe

    Well apparently it has something to do with the Internet Explorer, sort of. If I use Apple Safari it doesn't crash/lock up. But then again Safari is sending page images to the Acrobat printer, while the IE is sending the text as fonts. I also got stuck using winnovative free HTML to PDF Converter as another work around the #$%^ I paid for. Maybe it's not #$%^, but it's still annoying that I've had this problem since version 7 and I'm using version 9 now.

  • Print Templates print preview window closes unexpectly when printing document

    This is a cross posting from Internet Explorer Web Development after a suggestion that this forum would be a better location. See
    https://social.msdn.microsoft.com/Forums/ie/en-US/351e1245-b606-4467-9f3c-1c72f9cdf9ea/print-templates-print-preview-window-closes-unexpectly-when-printing-document?forum=iewebdevelopment.
    I have raised an issue through Connect for this:
    https://connect.microsoft.com/IE/feedback/details/1134168/ie9-to-ie11-print-templates-print-preview-window-closes-unexpectly-when-printing-document, but I would like some more visibility of the issue as my customers thought my application was closing when
    they printed a document.  I also don't know if an issue in Connect gets any priority support via MSDN, but this forum does.
    This looks to me like a problem in the IE Print Templates startDoc API call, but if there is a more appropriate forum to raise this issue in please let me know.
    In the application where I use print templates, the window closing is not in it self a problem because the Javascript that is calling startDoc also closes the Print Preview window when the print is finished.
    The fact that the application looses focus and can be hidden by the windows of other applications when the Print Preview window is closed by startDoc is the issue noticed by our customers, so I need a fix preferably, or a work around at a pinch.
    Details of the issue reproduced below.
    When using IE Print Templates, the startDoc function is causing the print preview window to close.  This behaviour started with IE9, and is still present with IE11.
    When an application is using print templates (see
    https://msdn.microsoft.com/en-us/library/aa753279(v=vs.85).aspx) for print functionality, this has the effect of causing the application to become hidden by any other application window once printing from the print preview window has started.  It is
    actually this behaviour that started me looking at this issue as the users thought the hosting application had closed.
    Print Templates are not accessible by using IE as a web browser, but only when using the WebBrowser Control to embed IE in an application.  The reference for this feature is available from this url:https://msdn.microsoft.com/en-us/library/aa753279(v=vs.85).aspx
    and a sample Microsoft application that demonstrates the use of Print Templates can be used to demonstrate the problem (required for the reproduction steps).  The application is available via this article and searching for "download spiffy".
    Steps to reproduce the problem:
    To see the full effect of the issue, first ensure there is a window from another application (like Windows Explorer) that will cover the sample applications window if brought to the foreground (making the Windows Explorer window full screen works).
    Start the sample application (and ensure that the full screen Window Explorer is the next application to activate).
    Then in the drop down box in the top right corner of the UI select Template8.htm.
    Click the Print Preview button that is just below the drop down box (this will open a new Print Preview window).
    In the new window click the Print… button (this will open a Print dialog).
    Click the Print button at the bottom of the Print dialog.
    The Print dialog closes (expected) and then the Print Preview window also closes (not expected), however the document is still printed successfully.
    When the Print Preview windows is closed unexpectedly, the Windows Explorer window is brought to the foreground (obscuring the sample applications window).
    If you reselect the sample application and click the Print Preview button again, the Print Preview dialog is not displayed unless you restart the application (this looks to be a symptom of the same issue, not a separate problem).
    To see that the Print Preview window appears to be closed by the startDoc call, use the resource editor in Visual Studio (the exe can be opened directly by File | Open | File…) to edit the HTML resource "TEMPLATE8.HTM" (I found I needed to delete
    it and add it back in for the change to stick), find the startDoc call and add two alerts, one on the line before and one on the line after.  When IE is accessing the template, it is being done using the name of the executable (so do not rename the modified
    version of printtemplates.exe, make the changes to a copy in a different directory if you don't want to change the original).  Start the modified version of the application and follow the same steps as in the reproduction.  This time, after clicking
    the Print button in the Print dialog, the dialog will close, the first alert will pop up, then the Print Preview window will close, then
    the second alert will pop up.
    Thank you,
    Warren.

    Hi Shu,
    I have noticed that the print templates API is listed as part of the Legacy APIs. 
    Is this just because it hasn't changed or is not new?  Or does this mean that it is no longer maintained and may be removed (or at least deprecated) at some point in the future? 
    It would good to know if we should start planning for the implementation of a different method of printing.
    I understand that the sample application is no longer maintained, but I also think that the Print Template API that it uses has not changed, and so should still work (and it does mostly).
    If the Print Preview window was being closed as a result of using the Print dialog (and if it had behaved the same way with IE8) I would be willing to go with the by design argument.  
    I have found that the Print Preview window is not closed until startDoc is called, and it closes before control is returned from the startDoc function. 
    Just as part of investigating and try to find a workaround, if I call window.close(), any alert calls made no longer display the alert window after the close call. 
    Alert still functions after startDoc has closed the window however. 
    The is not the sort of consistent behaviour I would expect from something that is by design. 
    Also while investigating, I found that calling startDoc after calling window.close() results in an exception with the error code -2147467259 (0x80004005), this is probably quite normal and expected, but does indicate that the Web Browser Control should
    not be closed till after printing.
    I had found that old thread, and I had concluded it was the same issue, but it was also aimed at different aspect of the problem (which I see in the sample application, but not my application). 
    The visible issue I have is that my users think the application has been closed because after clicking print (on the Print dialog) the application gets hidden by other windows from other applications. 
    This aspect affects the sample in the same manner and so it was a convenient way to demonstrate the problem.
    If IE connect do not look at this issue any time soon, do I have any other avenues to resolve this issue?
    Thank you,
    Warren.

Maybe you are looking for