Environment vaiables in portable file and folder use

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
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: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

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...

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: 67282
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @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: 67282
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @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.

Online
RalphM
Posts: 2145
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 26H2 Home x64 - XY: Current x64 beta - Office 2024 64-bit - Display: 1920x1080 @ 125%)

admin
Site Admin
Posts: 67282
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @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?

Online
RalphM
Posts: 2145
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 26H2 Home x64 - XY: Current x64 beta - Office 2024 64-bit - Display: 1920x1080 @ 125%)

admin
Site Admin
Posts: 67282
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @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.
xy.png
Terry
To see the attached files, you need to log into the forum.

admin
Site Admin
Posts: 67282
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @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: 67282
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @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