By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? Create shortcut with env var in path

I'm trying to create a shortcut with an environment variable in the path of the target.
[C:\Temp]shortcut "%%tools%%\apps\tcmd\tcc.exe" "" "" "Take Command Console" "Take Command Console.lnk" 1 "%tools%\apps\tcmd\tcc.exe" 0

But this results in a shortcut with the target: C:\Temp\%tools%\apps\tcmd\tcc.exe
Instead of the desired: %tools%\apps\tcmd\tcc.exe
The help says "Command is the full path of the executable file to start". You apparently don't want %tools% to be resolved when the shortcut is created, so perhaps TCC is trying to turn your specification (as it should?) into a full path.
I don't want to blow my own horn, but instead of SHORTCUT you could use MKSC (in UIStuff) and specify the /NC option, which bypasses the step of canonicalizing the target filename. (In your particular case you don't even need /NC; the command is smart enough to recognize that filenames beginning with a percent sign and a letter should not be canonicalized.)
true that's what SHORTCUT is doing, so is there a way around it, or can SHORTCUT allow this in the future?

Similar threads