SyMenu Forum

SyMenu

 

HomeTroubleshooting & Bug Reports

If you found a bug post here your report.

"." in a command parameter gets expanded Messages in this topic - RSS

Glenn
Glenn
Posts: 99


18/01/2016
Glenn
Glenn
Posts: 99
The attached shows an "echo ." command setup.
Sadly, what gets echoed is the path to the current directory.
I got excited when I discovered that "echo ^." didn't have that problem, but in non-CMD.exe programs, ^ just gets passed through.

So the question is, is there a SyMenu way to escape a "." so that it can get passed through to a program, instead of being modified from "." to the current directory path on the way?

In other words, not all "." are paths, or path prefixes. Sometimes, they are just a parameter to a command.
edited by Glenn on 18/01/2016

link
Gianluca
Gianluca
Administrator
Posts: 1274


19/01/2016
Gianluca
Gianluca
Administrator
Posts: 1274
What if I don't resolve the . (dot) when it is escape in the same way the cmd requires?
So if you write ^. I will leave the dot unresolved removing the ^.
If you need to leave the ^ character to escape the . even in the final command you can escape the escape character in this way ^^.
So the escaping chain will be
SyMenu ^^. -> ^.
The final command ^. -> .
link
Glenn
Glenn
Posts: 99


22/01/2016
Glenn
Glenn
Posts: 99
It occurred to me just a few moments ago, that this same technique might be appropriate to apply to #:\ ??? ^#:\ would have ^ removed, but be passed without expanding to the portable drive letter. I haven't played much with #:\ and do not know if replacement happens only with the 3-letter sequence, which is much more unlikely to occur than a single ".", and I don't know of any programs that take "#:\" as a command line parameter, so this one is likely less important. But if the replacement only depends on the #, then it could be critical to some applications.
link
Gianluca
Gianluca
Administrator
Posts: 1274


23/01/2016
Gianluca
Gianluca
Administrator
Posts: 1274
I think that an the escape character ^ could be considered only if used along with the dot char also because writing, for example, ^# is senseless as you stated.
So we can partially intend the ^ as an escape char. In the future we can extend its value as escaper if useful.

To summarize the replacement rules are:
.\ becomes D:\SyMenu\ProgramFiles\ (this is only an example of a possible resolution)
^.\ becomes .\
^^.\ becomes ^.\
link



UGMFree © 2002-2024
PayPal BTC TON