SetVarValidFilePath creates variables like a regular SetVar but transforms the value to a valid Windows file path.

All non-Windows-filepath-compliant characters: :?\"<>|{}*;^ are replaced by an underscore: _
Front slash / is replaced by backslash \

Tag Attributes

AttributesAttribute ValuesValue Description
Variable NameN/AAny unreserved name valid in XML. Reserved names are listed on: Variables
Variable ValueN/AAny string or number.
NewFileTrue / False If set to True, the file name shall be modified with a number increment so that it becomes unique.

Example Script

<ytriaAutomation>
	<SetVar MyPath="MuhFolder/My Export at 06:06:06 {is it large? nobody | knows;}"/>
	<SetVarValidFilePath MyPath="{%MyPath%}" MyOtherPath="C:\dev\Temp_XML\ProcessError.xml" NewFile="true"/>
	<Echo Value="{%MyPath%}"/>
	<Echo Value="{%MyOtherPath%}"/>
</ytriaAutomation>
XML

In this example, two file path are generated:



Since ProcessError.xml already exists and NewFile is set to "true" the new file name variable contains ProcessError (2).xml