Is there a way to figure out what a Windows LNK file is a shortcut to in Regina or one of the auxiliary libraries?
It may be easiest to use a 3rd-party utility to dump the link contents. Such as:
shortcut.exe /A:Q /F:<filename> Such a shortcut utilility is available at http://www.optimumx.com/download/#Shortcut There is another (with different syntax) somewhere at Microsoft too.
There is some shortcut functionality in Patrick McPhee's W32FUNCS package at http://www.interlog.com/~ptjm/ but I am not familiar with those functions.
You could read in the file with CHARIN, but this would be my last choice (as it's "ugly" and UNICODE). :-)
Thanks, Mark. Shortcut.exe looks like it will do the job for me. Do you know of anything that will translate Windows short names into long names?
Not in REXX that I know of...
It might be nice is SysFileTree() or STREAM 'C' 'FSTAT' could...
I am pursuing this in newsgroup:
"FQ longnamepath from shortnamepath?"
Where it is clear that shortcut.exe can be used to resolve the "expanded" FQP, but rather a kludge. (W2K)
You can use the following code to obtain the windows full path/file name from the short path/file name...
full_name = STREAM( short_name, 'C', 'QUERY EXISTS' )
The newsgroup mentioned above contains (Win32) one solution using shortcut.exe, one VBS solution and two different Batch techniques. There is also some discussion at newsgroup:
"FQ short/longnamepaths (Win32, Regina)"
And the possibility that a new function may be added to W32FUNCS soon.
Thanks for the interesting question on resolving LongNamePaths from ShorNamePaths. Learned something new. :-)
Just a note on my prior post: it only works if the short file path/name is that of a file which exists. If the file named does not exist, it will return an empty string. In that case, you could write a single byte to it, then obtain the full path/name and erase it.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.