Unsolved
This post is more than 5 years old
3 Posts
0
11028
December 22nd, 2006 16:00
Windows Shortcuts: Dynamic Evaluation of the Target Parameter
Does anyone know how to specify the drive letter in a path so that maybe referenced symbolically as the current drive with the "target" of a Windows shortcut (WinXP, Win2K, ...)? The problem occurs when you include a short cut that references a file (executable, image, ...) and Windows includes the full path name; e.g.,
D:\MyDir\jack.exe "D:\anotherDir\jill.jpg"
D:\MyDir\jack.exe "D:\anotherDir\jill.jpg"
In both paths "D:" is hard coded but if you move the device (e.g. thumb drive) and on a second computer the correct paths would be
F:\MyDir\jack.exe "F:\anotherDir\jill.jpg"
What I would like to do is edit and replace "D:" with the %CurrentDrive%:; e.g.
%CurrentDrive%:\MyDir\jack.exe %CurrentDrive%:\AnotherDir\jill.jpg
or whatever the correct symbolic reference would be. Note:
F:\MyDir\jack.exe "F:\anotherDir\jill.jpg"
What I would like to do is edit and replace "D:" with the %CurrentDrive%:; e.g.
%CurrentDrive%:\MyDir\jack.exe %CurrentDrive%:\AnotherDir\jill.jpg
or whatever the correct symbolic reference would be. Note:
%CWD% or %CW%
is the reference to the Current Working Directory in the Command Prompt interface and
%CW:~0,2%
returns the drive letter and colon, but apparenty the Win OS does not evaluate the parameters of the "target" at execution time (when you click on the shortcut) and "D:\%CW%\ ... " is passed on (and you cannot use "!" in lieu of "%" for deferred evaluation.) Also, you cannot use path relative expressions -- "." (current directory) or "..\" (parent directory). It appears that the only time the target of a shortcut is evaluated when it is edited and thereafter the parameters are passed on as a staic character string. Surely there is a way to have it evalauated ...?
If someone can help, this will be greatly appreciated.
Thanks!
Jerry_Linn@Juno.com
Thanks!
Jerry_Linn@Juno.com
No Events found!


Delierious
414 Posts
0
December 22nd, 2006 23:00
Jerry_Linn
3 Posts
0
December 24th, 2006 22:00