Forum Index  ViceVersa HOME         FAQ and Knowledge Base

 FAQForum FAQ   SearchSearch Forum  RegisterRegister 
 ProfileProfile   Log inLog in 

use variable in file path

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



Joined: 22 Feb 2015
Posts: 22

PostPosted: Sun Nov 18, 2018 5:12 pm    Post subject: use variable in file path Reply with quote

I am using ViceVersa on various computers. Some point the system Documents path at D:\My Documents\ and some at C:\users\User\Documents.
Is there any way I can use an environment variable in the ViceVersa profile definition to be able to use the same profile in both cases?
I would like to be able to use long pathnames.
Back to top
jacobacci



Joined: 22 Feb 2015
Posts: 22

PostPosted: Sun Nov 18, 2018 6:10 pm    Post subject: Reply with quote

ok, did a bit of digging and got this far:
Using power shell apparently it is possible to get the mydocuments path through the windows API using
[environment]::getfolderpath("mydocuments").
If I could find a way to write this value to an environment variable DOCSPATH, I guess I'd be home. Then I would simply use %DOCSPATH% (or rather <DOCSPATH>) in the sync profile.
Can anyone point me in the right direction how to achieve this?
Thanks a lot
Back to top
TGRMN Software
Site Admin


Joined: 10 Jan 2005
Posts: 8763

PostPosted: Mon Nov 19, 2018 12:49 am    Post subject: Reply with quote

Hi,

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.
_________________
--
TGRMN Software Support
http://www.tgrmn.com
http://www.compareandmerge.com
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: