Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Special syntax for shim's directory / shim's target #7

Open
God-damnit-all opened this issue Sep 23, 2022 · 2 comments
Open

[FR] Special syntax for shim's directory / shim's target #7

God-damnit-all opened this issue Sep 23, 2022 · 2 comments

Comments

@God-damnit-all
Copy link

God-damnit-all commented Sep 23, 2022

There was progress made in #1 for this feature, and even some code reviewing done, but it seems to have stalled.

While %~dp0 is an option, I am bothered a bit by the fact that both % and ~ are allowed as part of filenames. Using characters that aren't allowed would be better.

My suggestion is <:/ /:> with a single-letter parameter in-between, as I feel that would be difficult to ever purposely put in as an argument for any other purpose.


Proposed syntax example

Shim executable: C:\Program Files (x86)\Example Directory\shim.exe

Desired Result Syntax Output
full path <:/f/:> C:\Program Files (x86)\Example Directory\shim.exe
directory <:/d/:> C:\Program Files (x86)\Example Directory
parent dir <:/p/:> C:\Program Files (x86)
child dir name <:/c/:> Example Directory
base name <:/b/:> shim
extension <:/x/:> .exe
name.ext <:/n/:> shim.exe

Prefixing the letter with a ! on the args = row would instead point to the path = path
e.g. using <:/!f/:> with path = cmd.exe would make <:/!f/:> resolve to C:\Windows\System32\cmd.exe

@God-damnit-all
Copy link
Author

@kiennq I clarified the bit about the ! prefix at the bottom, since I think the way I worded it before was confusing.

@kiennq
Copy link
Owner

kiennq commented Mar 6, 2024

The ! requires us to find the full path for the launch cmd. I want to avoid that if possible as it can also imply security issues if we resolve to a wrong path.
Let me implement the <:/../:> first to see how it's going.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants