.bat file that will run under scheduled tasks

I want to create a .bat file will look for certain file under certain folder if the file is found then it will open another excel workbook. I would like to run .bat file under scheduled task..please give me some guidance in creating this file.

Thank you.
AiyshaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

shinobunCommented:
if exist [certain file] excel.exe [excel workbook]

For more information on the "if" command, do "if /?" in the command prompt.
MohsanCommented:
IF EXIST C:\TEMP\NUL.txt
above command will check for existance of file
md c:\temp
above command will create folder temp


for details visit
http://www.robvanderwoude.com/index.html

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AiyshaAuthor Commented:
Can you please see what is wrong in the following commands


@ECHO OFF
IF EXIST Z:\newpoints GOTO ONE
ONE:
copy /Y "Z:\NEWPOINTS" "c:/Program Files/C3"
start "C:\Program Files\C3\ComInput2.xls"
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

shinobunCommented:
What are you observing?  Any error messages, expected and actual behavior would help us guide you to the right direction.  :)

1. It will run even if the file doesn't exist.  You need to GOTO to the bottom of the file before the ONE: label.

2. I think you should use "cmd /c" instead of "start".  For more information, do "cmd /?" in the command prompt.
MohsanCommented:
start "C:\Program Files\C3\ComInput2.xls"

start is used to open a new cmd window it will not open excel file
MohsanCommented:
it should be like that

start excel "C:\Program Files\C3\ComInput2.xls"
AiyshaAuthor Commented:
shinobun,
thats what I am noticing, it runs even if it doesnt find the file.
shinobunCommented:
@ECHO OFF
IF EXIST Z:\newpoints GOTO ONE
GOTO TWO
ONE:
copy /Y "Z:\NEWPOINTS" "c:/Program Files/C3"
start "C:\Program Files\C3\ComInput2.xls"
TWO:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.