Forum Index  ViceVersa HOME         FAQ and Knowledge Base

 FAQForum FAQ   SearchSearch Forum  RegisterRegister 
 ProfileProfile   Log inLog in 

Filename text substitution

 
Post new topic   Reply to topic     Forum Index -> Support
Author Message
simonw



Joined: 03 Oct 2024
Posts: 2

PostPosted: Thu Oct 03, 2024 1:45 pm    Post subject: Filename text substitution Reply with quote

Is it possible to specify the folder you want to copy to but include a string to be substituted at runtime?

For example, my source folder could be

C:\Source\FolderToCopy\

and I want to copy it to

D:\Backup\FolderToCopy-2024-10-03\

Where the date would be the date at runtime, something like

D:\Backup\FolderToCopy-[datetime]\
Back to top
TGRMN Software
Site Admin


Joined: 10 Jan 2005
Posts: 8769

PostPosted: Fri Oct 04, 2024 6:10 am    Post subject: Reply with quote

Use:
D:\Backup\FolderToCopy-<year>-<month>-<day>\

You can use variable macros (also known as Folder Variables, see help file) as part of folder names for Source, Target, Log File, Archive Folders, Tracking Database, Custom Scripts and Filters. ViceVersa will expand these variables to the appropriate values when running the profile. Variable names must be enclosed between < > (for example: <var>).

This is a list of variables supported by ViceVersa PRO with explanations on how they are expanded.

Variable Explanation
<year> A four digit year (e.g. 2006).
<month> A two digit month.
<day> A two digit day.
<hour> A two digit hour.
<min> A two digit minute.
<sec> A two digit second.
<date> Equivalent to <year><month><day>
<dayofweek> One digit day of the week. 1 = Sunday, 2 = Monday, ..., 7 = Saturday.
<time> Equivalent to <hour><min><sec>
<profile> Profile name. If no profile is loaded it will be replaced by text "unknownprofile"
<profilepath> Profile path. If no profile is loaded it will be replaced by text "unknownprofilepath"
<computer> The name of the computer in the network.
<user> The name of the user logged on.
<source> This variable can only be used for targets. It expands to the corresponding source folder. For instance if the source is "C:\source\folder\" and the target is "E:\target\folder\<source>\", the variable expands the target to "E:\target\folder\C\source\folder\".
<sourcewithoutdrive> This variable can only be used for targets. It expands to the corresponding source folder, but without drive. For instance if the source is "C:\source\folder\" and the target is "E:\target\folder\<sourcewithoutdrive>\", the variable expands the target to "E:\target\folder\source\folder\".
<leaf> This variable can only be used for targets. It expands to the last subfolder of the corresponding source folder (a.k.a., the 'leaf' subfolder). For instance, if the source is "C:\source\folderA\", the leaf subfolder is the last subfolder in the path, i.e., folderA. If the target is "E:\target\<leaf>\", the variable <leaf> makes the target into "E:\target\folderA\".
<cd> It expands to the current directory.
<cdwithoutdrive> It expands to the current directory, but without drive.
<label:XXXXXXXX> It expands to the drive letter assigned to the drive with label XXXXXXXX. For example, <label:My-Usb-Drive>:\FolderA\ expands to S:\FolderA\ if the drive letter assigned to the drive with label 'My-Usb-Drive' is 'S'.
Please note: this variable can't be used with the tracking database or the synchronization method.
<serial:XXXXXXXX> It expands to the drive letter assigned to the drive with serial XXXXXXXX. For example, <serial:A2FF003E>:\FolderA\ expands to X:\FolderA\ if the drive letter assigned to the drive with serial number 'A2FF003E' is 'X'.
Please note: this variable can't be used with the tracking database or the synchronization method.
Note: you can also use the standard Windows Environment Variables in the source(s) and the target(s), but you need to use '<' instead of '%', due to the fact that '%' is a valid character for a folder name unlike '<'
Windows Environment Variables Any Windows Environment Variable can be used as a folder variable, but '<' must be used instead of '%'.
For example:
%ALLUSERSPROFILE% becomes <ALLUSERSPROFILE>
%COMPUTERNAME% becomes <COMPUTERNAME>
%HOMEPATH% becomes <HOMEPATH>
%WINDIR% becomes <WINDIR>
etc.

Variables can be used for Sources, Targets, Archive Folders, Log File, Tracking Database, Custom Scripts and Filters
_________________
--
TGRMN Software Support
http://www.tgrmn.com
http://www.compareandmerge.com
Back to top
simonw



Joined: 03 Oct 2024
Posts: 2

PostPosted: Fri Oct 04, 2024 8:09 am    Post subject: Reply with quote

Perfect. Thank you for the reply
Back to top
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Support All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can 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 © phpBB Group
Copyright © TGRMN Software. TGRMN Software products: