I’m running cmd.exe code directly from within a windows shortcut .lnk file rather than in .bat text file; example:
%COMSPEC% /Q /V:ON /C “SET QUERY=StackOverflow && ECHO Hello !QUERY!”
Noting, the reason I’m running code like this is due to group policy restrictions. So I’ve been learning the joys of single-line coding with only 260 available characters! :)
And I’m looking for an equivalent to %0
in batch files that can return me the source file of the shortcut itself? Or at least the folder it started in?
Noting I can’t just simply just set the shortcut’s ‘Start In’ directory, because I want to retain the original %CD%
that called the shortcut.
I don’t think it’s even possible. But if anyone at least has any good general tips for single-line coding then please share!