Environment vaiables in portable file and folder use

Things you’d like to miss in the future...
Post Reply
Terry
Posts: 8
Joined: 02 May 2008 18:51

Environment vaiables in portable file and folder use

Post by Terry »

I really like the "portable file associations" and "portable open with" abilities. There is one inconsistency that I would like for you to fix.

For a file I can use environment variables as shown here:
ini>%epPrgspc%

But for a folder I cannot use environment variables as shown here:
\>"%xnvPrgspc%

In either case I can enter exact paths or portable paths using "?".

I use environment variables extensively in both desktop and portable computers. It should be an easy thing for you to allow environment variables for both files and folders.

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Environment vaiables in portable file and folder use

Post by PeterH »

I think you should show a bit more of your usage of the strings.

Especially in the second I see double quotes inside the string - but can't understand what it's about...
Win11 Pro 223H2 Gerrman

Terry
Posts: 8
Joined: 02 May 2008 18:51

Re: Environment vaiables in portable file and folder use

Post by Terry »

The correct example is:
\>%xnvPrgspc%

I tried the directory portable syntax both without double quotes and with double quotes:
\>%xnvPrgspc%
\>"%xnvPrgspc%"

When I posted to the forum I failed to delete the first double quote.

The problem is simple. Portable file associations work with actual file path specified and with an environment variable that holds the actual file path.

Directory associations work only with an actual folder path but NOT with an environment variable that holds the actual folder path.

I am using XYplorer 13.40.0100

I think that both file and folder associations should work with both actual path stings and environment variables that hold the actual path strings.

admin
Site Admin
Posts: 60612
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Environment vaiables in portable file and folder use

Post by admin »

Works fine here. :?

Here are my test definitions. Both work:

Code: Select all

"ACDC (Env Folders)" \>%ProgramFiles%\ACDSee32\ACDSee32.exe
"ACDC (Env)" jpg;png;gif>%ProgramFiles%\ACDSee32\ACDSee32.exe

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Environment vaiables in portable file and folder use

Post by Stefan »

Terry wrote:The correct example is:
\>%xnvPrgspc%
How is the whole command line?


And maybe, to what points your %xnvPrgspc% ?



.

Terry
Posts: 8
Joined: 02 May 2008 18:51

Re: Environment vaiables in portable file and folder use

Post by Terry »

Responding to admin: "works fine here"

I have done some more fiddling. The environment variable "xnvPrgspc" is 58 characters long which does not work. Things seem to work okay if I use shorter strings in an environment variable.

Further, if I use an environment variable that holds about 25 characters of the full path and then add literal characters to complete the path, then it works.

My guess is that your program limits the length of an environment variable that may be used.

I have not done a lot of fiddling/testing to see what is the maximum length that an environment variable may be.

In my situation, I use environment variables extensively, and I hope that we can get this issue figured out and/or fixed.

admin
Site Admin
Posts: 60612
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Environment vaiables in portable file and folder use

Post by admin »

There is no such limit. I have longer ones and they work fine.

RalphM
Posts: 1935
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: Environment vaiables in portable file and folder use

Post by RalphM »

Could there be a problem with quoting if the path contains blanks?
Ralph :)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

admin
Site Admin
Posts: 60612
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Environment vaiables in portable file and folder use

Post by admin »

OP says there is a difference between files and folders in PFA. Why should length or blanks play a role here?

RalphM
Posts: 1935
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: Environment vaiables in portable file and folder use

Post by RalphM »

Was just my 0.02 cents since we had some trouble with blanks in path names before, but you're right about his statement in OP.
Just the later addition that it works up to a certain length made me think about blanks.
Didn't mean to confuse anybody.
Ralph :)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

admin
Site Admin
Posts: 60612
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Environment vaiables in portable file and folder use

Post by admin »

No offense, I was just thinking aloud. It's a weird issue and "xnvPrgspc" is a weird variable. :)

Terry
Posts: 8
Joined: 02 May 2008 18:51

Re: Environment vaiables in portable file and folder use

Post by Terry »

Responding to admin (It's a weird issue and "xnvPrgspc" is a weird variable).
It is a custom variable. I use MANY such environment variables to coordinate various systems, users and so forth. I began programming in 1967 for the university system in my state in the U. S. Now to the current situation. Limiting discussion to a particular.

I define the the following two env variables (among many others):
portableappsDir=c:\portable\portableapps
xnvPrgspc=c:\portable\portableapps\xnviewPortable\xnviewPortable.exe

The attached image file ("Portable File Associations box") has 7 entries that show variations on using literals, environment variables, and combinations of the two. 4 of the 7 are recognized (that is work) and 3 of the 7 are NOT recognized (that is do NOT work).

Further information. Sometimes env variables work. I cannot find a reason for this strange behavior or find consistent behavior. That is why I suspect an elusive bug (problem) in the coding. I do not rule out that I am doing something dumb, but I cannot find out what. Perhaps with this specific information, you can determine if there is a screwy bug on prehaps alzeimers is setting in for an old man.
Portable File Associations box
Portable File Associations box
xy.png (12.26 KiB) Viewed 2295 times
Terry

admin
Site Admin
Posts: 60612
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Environment vaiables in portable file and folder use

Post by admin »

When you click menu Help / Environment Variables, is %xnvPrgspc% listed there?

Terry
Posts: 8
Joined: 02 May 2008 18:51

Re: Environment vaiables in portable file and folder use

Post by Terry »

Response to Admin "When you click menu Help / Environment Variables, is %xnvPrgspc% listed there?"

No it is not.

But when I run (in a DOS command window) the command line "set xnv" it is there as shown in the following three lines copied from a dos window. The command line and the two lines response are copied and pasted, not typed, below.

The command line and the two line response.

set xnv
xnvPrgdir=c:\portable\portableapps\xnviewPortable
xnvPrgspc=c:\portable\portableapps\xnviewPortable\xnviewPortable.exe

Further, I use the environment variable in other programs (such as, Winbatch) and it works just fine. That is the xnviewportable.exe program runs. I have been using this env variable for years with multiple programs. They all work just fine. Only xyPlorer is having problems.

admin
Site Admin
Posts: 60612
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Environment vaiables in portable file and folder use

Post by admin »

I might have fixed it. Please try the next beta version (upload soon).

Post Reply