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

I am trying to replace one of my outdated powershell scripts with a task that does the following. (There's more, but this is the part i'm stuck on)

1. List all *.VIE files in a folder (i.e. C:\Temp\Source)

Begin Loop:
2. Copy File (filename.VIE) to C:\Temp\Destination and rename to filename.TMP (this works)
3. Create a file (same as filename.VIE but with a CDP extension) using the write file (this works)
End Loop:

Here's my problem. It's POSSIBLE that there is a VIE and an FHFT file with the same name in the Source. If the FHFT file exists, I want to create that CDP file (TASK 3). If it does not exist, TASK 3 should be skipped. Seems easy, right?

I created a condition on STEP 3 that will ONLY run if an FHFT (filename.FHFT) exists in the source. If this condition is not true, STEP 3 does not run, Perfect. However, I'm finding that it never runs because it never sees an equally named FHFT file. Are variables like the following, not allowed if doing a condition for "File Exists = True"?


The above string is what I have in my 'File path' for the Condition type of 'File'.

Effectively, in my loop, if there was a file named TESTFILE1.VIE, I want the condition to be that TESTFILE1.FHFT exists before TASK 3 runs. If not, it should go onto the next tasks I have in the job and/or loop.

Is this possible? I'm betting not based on what I am experiencing, but i thought i'd ask.

I can probably go the route of creating a variable, running TASK 3, and then deleting the variable so that the condition could be true. but thats ugly, assuming it works.

Forum information
Scroll to Top