Agenor said:
Is it possible to give a windows shortcut a relative
address? I need to do this so that when the shortcut and
the files it points to are moved, then the shortcut still
points to the file.
Are there any other ways of doing this wihtout knowing
the file destination beforehand?
All external paths are relative in that a path is essentially a redirector
to a location. Imagine a mapped drive pointing to a serverA by using a login
script (net use H: \\serverA\sharedDir) and a local shortcut points to the
mapped H:.
If you move the files to a serverB then the login script, not the shortcut,
needs to be changed (net use H: \\serverB\sharedDir). In fact, such a change
to a share is virtually transparent to the user of the scripted share.
Net use can even be specified for a local directory (net use h: /home
/user:thisDude). The drive letter continues to be h:. The shortcut itself
remains unchanged. Only the batch needs to be modified.
There are many other ways to achieve a transparent redirection. Environment
variables, DNS alias, ldap, DFS, etc. Essentially, what you are trying to
achieve is what networks are designed for: transparency.