IFE context

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
asardina
Newbie
Posts: 8
Joined: Wed Jul 25, 2007 4:00 pm

IFE context

Post by asardina » Thu Aug 02, 2007 5:03 pm

I am trying to copy a file if the file exists. If the file does not exist then I want to execute a mdb application that sends an email. I cannot get the mdb to execute when the file is not available. Below is the code I have. Any hel would be appreciated

IfFileExists>\\Nyhcbapp32v\FTProot\GSHOP\WFM2.txt
then CopyFile>\\Nyhcbapp32v\FTProot\GSHOP\WFM.txt,\\Nyhcbapp32v\FTProot\PSCCSA\WFM.txt
Else Run Program>C:\Program Files\Microsoft Office\Office11\MSAccess.exe "E:\DATABASES\STS Requests\JohnFinney\Dave F\GasCar_CustDataExtract\email.mdb" /x "WTYtxt"
endif

User avatar
JRL
Automation Wizard
Posts: 3505
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Aug 02, 2007 5:32 pm

Your syntax is a little off. You don't need the "then" although its probably not hurting anything if it was on a separate line as it appears in the forum posting. After I pasted your code into the Macro Scheduler editor It showed up on the same line and ahead of copyfile> so I question whether you ever actually got copyfile> to function. Also "else" and "Run program" need to be on separate lines.

Code: Select all

IfFileExists>\\Nyhcbapp32v\FTProot\GSHOP\WFM2.txt
CopyFile>\\Nyhcbapp32v\FTProot\GSHOP\WFM.txt,\\Nyhcbapp32v\FTProot\PSCCSA\WFM.txt
Else
Run Program>C:\Program Files\Microsoft Office\Office11\MSAccess.exe "E:\DATABASES\STS Requests\JohnFinney\Dave F\GasCar_CustDataExtract\email.mdb" /x "WTYtxt"
endif

asardina
Newbie
Posts: 8
Joined: Wed Jul 25, 2007 4:00 pm

Post by asardina » Thu Aug 02, 2007 5:38 pm

Thanks

That worked great! :D

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts