Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: bat file - how to ignore window errors  (Read 7230 times)

0 Members and 1 Guest are viewing this topic.

AlexB

  • Guest
bat file - how to ignore window errors
« on: April 11, 2007, 08:42:45 AM »
I'm launching pdf files within a bat file.  I pass the instruction into bat file as a parm.  It works great except for when the pdf doesn't exist and displays error window.  Is there any way to ignore the error and don't display the error window?  Is there a way to check if the pdf exist first before launching the pdf? 

The bat file has the following code:

@Echo off
start %1
EXIT

The following is the nstruction sent as a parm:

\\USDCAWS37750237\softwares\Temp\PDFs\CBL_2005.pdf

Thanks,
Alex(newbie)

[old attachment deleted by admin]

2k_dummy



    Specialist
  • A word, once spoken, can never be recalled.
  • Thanked: 14
    Re: bat file - how to ignore window errors
    « Reply #1 on: April 11, 2007, 10:48:24 AM »
    Try using the IF command. Type IF /? at the command prompt.
    If you don't stand for something, you'll fall for anything.
    _______________________________________ ________
    BlackViper

    Software and utilities

    AlexB

    • Guest
    Re: bat file - how to ignore window errors
    « Reply #2 on: April 11, 2007, 01:03:27 PM »
    Your suggestion worked indirectly.  I entered "IF /?" and it returned an syntax error displaying possible corrections which mentioned "Exist".  The combination of "IF EXIST filename START filename" worked.
    Thanks for the tip!
    Alex