[GH-ISSUE #65] Environment variables #64

Closed
opened 2026-02-25 21:32:34 +03:00 by kerem · 10 comments
Owner

Originally created by @Inesicen on GitHub (May 4, 2019).
Original GitHub issue: https://github.com/clechasseur/pathcopycopy/issues/65

Originally assigned to: @clechasseur on GitHub.

How can I copy paths with environment variables like %PROGRAMFILES(x86)% and %USERPROFILE%?

Originally created by @Inesicen on GitHub (May 4, 2019). Original GitHub issue: https://github.com/clechasseur/pathcopycopy/issues/65 Originally assigned to: @clechasseur on GitHub. How can I copy paths with environment variables like `%PROGRAMFILES(x86)%` and `%USERPROFILE%`?
kerem 2026-02-25 21:32:34 +03:00
Author
Owner

@clechasseur commented on GitHub (May 4, 2019):

I'm not sure I understand. Where exactly would you be copying those paths? Do you mean you want to copy a path and replace part of it with an environment variable?

<!-- gh-comment-id:489295369 --> @clechasseur commented on GitHub (May 4, 2019): I'm not sure I understand. Where exactly would you be copying those paths? Do you mean you want to copy a path and replace part of it with an environment variable?
Author
Owner

@blackcrack commented on GitHub (May 4, 2019):

@clechasseur
second ... AltText
..... AltText
open cmd :
echo %PROGRAMFILES(x86)% >> blead.txt , open it with notepad3 and copy it ..
this is a possible way..
but we are not a support forum ..

<!-- gh-comment-id:489302845 --> @blackcrack commented on GitHub (May 4, 2019): @clechasseur second ... ![AltText](http://www.blackysgate.de/files/folder-root/smilys/kolobok.us-0/kez_08.gif) ..... ![AltText](http://www.blackysgate.de/files/folder-root/smilys/kolobok.us-0/kuzya_02.gif) open cmd : echo %PROGRAMFILES(x86)% >> blead.txt , open it with notepad3 and copy it .. this is a possible way.. but we are not a support forum ..
Author
Owner

@clechasseur commented on GitHub (May 4, 2019):

Ok… but Path Copy Copy is not used at all in your example… which is basically what prompted my initial question :-)

<!-- gh-comment-id:489358359 --> @clechasseur commented on GitHub (May 4, 2019): Ok… but Path Copy Copy is not used at all in your example… which is basically what prompted my initial question :-)
Author
Owner

@Inesicen commented on GitHub (May 5, 2019):

If I am copying a path for which an environment variable exists, I would like to be able to copy the path with the variable.

<!-- gh-comment-id:489453346 --> @Inesicen commented on GitHub (May 5, 2019): If I am copying a path for which an environment variable exists, I would like to be able to copy the path with the variable.
Author
Owner

@clechasseur commented on GitHub (May 5, 2019):

Interesting idea. But how would be proceed if multiple environment variables exist for the path? Do we go alphabetically?

<!-- gh-comment-id:489469105 --> @clechasseur commented on GitHub (May 5, 2019): Interesting idea. But how would be proceed if multiple environment variables exist for the path? Do we go alphabetically?
Author
Owner

@blackcrack commented on GitHub (May 5, 2019):

humm..
"[if included %PROGRAMFILES(x86)% == %PROGRAMFILES(x86)%]
copy "%PROGRAMFILES(x86)%\path\blabla, "
else
\path\blabla (or C:\path\blabla)
"
something in this direction, could be not a bad idea... :) 👍
"Copy path with Enviroment Variable" (if variable exist)"

<!-- gh-comment-id:489470128 --> @blackcrack commented on GitHub (May 5, 2019): humm.. "[if included %PROGRAMFILES(x86)% == %PROGRAMFILES(x86)%] copy "%PROGRAMFILES(x86)%\path\blabla, " else \\path\blabla (or C:\path\blabla) " something in this direction, could be not a bad idea... :) :+1: "Copy path with Enviroment Variable" (if variable exist)"
Author
Owner

@clechasseur commented on GitHub (Jan 7, 2020):

Looks like this is what we want:

https://docs.microsoft.com/en-us/windows/win32/api/shlwapi/nf-shlwapi-pathunexpandenvstringsw

<!-- gh-comment-id:571542512 --> @clechasseur commented on GitHub (Jan 7, 2020): Looks like this is what we want: https://docs.microsoft.com/en-us/windows/win32/api/shlwapi/nf-shlwapi-pathunexpandenvstringsw
Author
Owner

@clechasseur commented on GitHub (Jan 9, 2020):

This has been implemented as a custom command element in the next major release (tentatively 18.0).

<!-- gh-comment-id:572407862 --> @clechasseur commented on GitHub (Jan 9, 2020): This has been implemented as a custom command element in the next major release (tentatively 18.0).
Author
Owner

@Inesicen commented on GitHub (Jan 29, 2020):

Thank you; I just note that %ProgramFiles% (x86) should be %ProgramFiles(x86)%.

<!-- gh-comment-id:579600509 --> @Inesicen commented on GitHub (Jan 29, 2020): Thank you; I just note that `%ProgramFiles% (x86)` should be `%ProgramFiles(x86)%`.
Author
Owner

@clechasseur commented on GitHub (Jan 29, 2020):

Thank you; I just note that %ProgramFiles% (x86) should be %ProgramFiles(x86)%.

Is that something from this issue or did you really see this being replaced by the custom command element? If the latter, you can enter a separate bug and I will look at it.

<!-- gh-comment-id:579704684 --> @clechasseur commented on GitHub (Jan 29, 2020): > Thank you; I just note that %ProgramFiles% (x86) should be %ProgramFiles(x86)%. Is that something from this issue or did you really see this being replaced by the custom command element? If the latter, you can enter a separate bug and I will look at it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/pathcopycopy#64
No description provided.