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


TempName
2016-03-29T12:36:31Z
I am using a simple FileCopy task. The variable which contains the target file path was populated from a string with contents set to something along the lines of
\\MyServer.mydomain.com\Share\{DATEFORMAT(yyyyMMdd)}\MyFolder

However, when I run the task it fails with

Exception in Task: System.ArgumentException: Illegal characters in path.
along with a stack dump.
I have double checked the path up to DATEFORMAT by pasting into Windows Explorer (which works ok).
What have I done wrong?
Sponsor
Forum information
al355
2016-03-29T12:53:51Z
Have you tried putting in an error notification so you can see what the variable is at run-time?
TempName
2016-03-29T13:35:36Z
I am fairly new to VC so am not fully up to speed with debugging.
I added a couple of tasks in at the start to set the paths I wanted and then sent an email with the 2 variables in the body to myself (this seems a long winded way of finding out what value is actually in a variable).
The first variable ("FileName") looked correct as it had a valid path in it. The second variable was being set to
{PATH(GetFileName|{JOB(Active,Variable,FileName)}}
Although "{JOB(Active,Variable,FileName)}" is was resolved correctly the outer PATH function was not i.e. the email showed {PATH(GetFileName|<full path>}
Support
2016-03-30T10:03:19Z
Please send us the exact path that you are using. It is very common that our users fail when doing something like this because they include colon (:) in the date Variable which is a character not supported.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
TempName
2016-03-30T15:44:42Z
After further testing it seems the root problem is not the DATEFORMAT function. The issue appears to relate to {PATH(GetFileName|<path>} and {PATH(GetDirectoryName|<path>)}. If I hard code a full path for a file in <path> it does not appear to get resolved and adds the function text (i.e. "{PATH(GetFileName|<path>}") as the value in the new variable instead,
Support
2016-03-30T17:09:51Z
Originally Posted by: TempName 

After further testing it seems the root problem is not the DATEFORMAT function. The issue appears to relate to {PATH(GetFileName|<path>} and {PATH(GetDirectoryName|<path>)}. If I hard code a full path for a file in <path> it does not appear to get resolved and adds the function text (i.e. "{PATH(GetFileName|<path>}") as the value in the new variable instead,



Before using it in your Task just write the values to file using the Write file Task.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top