Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


sheepy121
2011-11-13T20:53:53Z
Hi all. I have a job with a trigger (which is to detect when a file is placed in folder "C:\a"or a subdirectory) and a task which runs an executable (C# app I made), I am new to visualcron and would like to know what I would put in the "arguments" field for the task if i wanted to pass the name of the folder the file was placed in.

for example, place a file in folder in C:\a\peter
trigger runs task which runs exe and passes as arg "peter"

(please note I am running visualcron v5 and cannot change this)

Thanks for any help 🙂
Sponsor
Forum information
Support
2011-11-14T08:09:26Z
Use this Variable:

{TRIGGER(Active|LastTrigger|File.Result.Folder)}
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
osirisja
2011-11-14T08:36:13Z
Hi Sheepy121

First thing - I am running V6.04 and I have no idea whether all of this would apply in Version 5, so try it and see.

Ok, in variables 'Visual cron variables\jobs\active jobs\triggers\last trigger\file\result', the VC variable '{TRIGGER(Active|LastTrigger|File.Result.Folder)}' (using your example) is going to return 'C:\a\peter'.

From what you are saying, I understand you are only interested in the 'peter' folder name? I have achieved a similar thing in the past by using the REGEX function (also available from the Variables dialogue). However, this particular string was designed to extract the second last folder in the path string (in your example - 'a'). I had it defined in a Variable:

{REGEX(Match|{TRIGGER(Active|LastTrigger|File.Result.Folder)}|[^\\]+(?=\\[^\\]+$))}

Unfortunately, I know nothing about REGEX but having a quick mess about with the third party 'Expresso' tool, the following regex seems to work:

\\([^\\]+$)

Whatever variable string you define, you can add it into a VC User variable, or define it directly on your Execute Task 'Arguments' field.

Hope that has given you some ideas...

Cheers

Andy
sheepy121
2011-11-15T06:32:27Z
Hi guys, thanks for responding, as the trigger exists on C:\a and not on C:\a\peter - {TRIGGER(Active|LastTrigger|File.Result.Folder)} will return C:\a and not C:\a\peter

The trigger is hit when i dump a file into any subfolder in C:\a

so when i put 1.txt into C:\a\peter

{TRIGGER(Active|LastTrigger|File.Result.Folder)} will retrun C:\a
{TRIGGER(Active,LastTrigger,File.Result.Name)} will return 1.txt

I need to get peter, i need to know the name of the folder the file was placed in so i can trace it to that person.

Do you guys know how i can get it?
sheepy121
2011-11-15T06:54:28Z
GOT IT YAY

{TRIGGER(Active,LastTrigger,File.Result.FullPath)}

Tnks for the help guys 😃
osirisja
2011-11-15T07:58:07Z
Good Stuff Sheepy121 😂

Clever piece of software this Visual Cron is! :-)

Cheers

Andy
Scroll to Top