hiteksoftware.com Forum Index hiteksoftware.com
User discussion forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Script: Kick off a task if 13 out of 13 files exist

 
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Task Sequences, Chains and Scripts
View previous topic :: View next topic  
Author Message
melvin
Site Admin


Joined: 25 May 2006
Posts: 631
Location: Santa Barbara, california

PostPosted: Fri Aug 25, 2006 3:30 pm    Post subject: Script: Kick off a task if 13 out of 13 files exist Reply with quote

This is an email support request:

I need to kick off a task ONLY if all thirteen of thirteen files exist.

Is this possible?
Back to top
View user's profile Send private message Send e-mail
melvin
Site Admin


Joined: 25 May 2006
Posts: 631
Location: Santa Barbara, california

PostPosted: Fri Aug 25, 2006 3:32 pm    Post subject: Reply with quote

2 ways to do this:

1) Use 13 file monitor tasks in sequence in a chain. If all 13 return exit code = -100, run the 14th step , i.e. the task you need. Else exit the chain at any step if exit code = 0.

OR

2) Use a script task in Automize Professional or Enterprise:

import com.hitek.engine.mods.script.Script;

File f1 = new File("c:\\test\\dir1", "name1");
File f2 = new File("c:\\test\\dir2", "name2");
...
File f13 = new File("c:\\test\\dir13", "name13");


if(f1.exists() && f2.exists()....... && f13.exists())
{
Script.out("All files exist.");
Script.run("task_title");
}
else
{
Script.out("One or more files are missing.");
}
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Task Sequences, Chains and Scripts All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group