Run IF AND

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
hip2b2
Newbie
Posts: 9
Joined: Thu Nov 05, 2009 4:41 am

Run IF AND

Post by hip2b2 » Mon Dec 12, 2011 4:01 pm

I am trying to build what is a simple macro but am so far unsuccesful.

My objective is to:
1 - Test for file (%Path%\Folder_n\data.csv)
2 - If file exists then a run VBS script AND wait 60 seconds before continuing
3 - If file does not exist then do nothing and move on to next If routine.

Code: Select all

//Variables
//Set Common Path
  Let>Path=C:\WorkFolder
//Set Wait Time  
  Let>WaitTime=60

IfFileExists>%Path%\Folder_1\data.csv
    run>"C:\Program Files\Folder\RunProject1.vbs"
    Wait>WaitTime
    Else
    //DO nothing
EndIf

IfFileExists>%Path%\Folder_2\data.csv
    run>"C:\Program Files\Folder\RunProject2.vbs"
    Wait>WaitTime
    Else
    //DO nothing
EndIf
Any help will be appreciated.

Many Thanks in advance.

hip

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Dec 12, 2011 4:46 pm

You will need to use ExecuteFile not Run:

ExecuteFile>C:\Program Files\Folder\RunProject2.vbs

Aside from that which part isn't working?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

hip2b2
Newbie
Posts: 9
Joined: Thu Nov 05, 2009 4:41 am

Post by hip2b2 » Mon Dec 12, 2011 5:32 pm

I thought that the "Wait>WaitTime" was not running as part of "IFFileExists" = True, but it appears once again I was wrong.

Thanks for the help.

h

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