Groups | Search | Server Info | Login | Register


Groups > comp.os.ms-windows.programmer.win32 > #8519

Re: How to create a relative shortcut ?

From Jakob Bohm <egenagwemdimtapsar@jbohm.dk>
Newsgroups comp.os.ms-windows.programmer.win32, alt.comp.os.windows-xp, alt.windows7.general
Subject Re: How to create a relative shortcut ?
Date 2025-09-04 09:17 +0200
Organization Privat
Message-ID <109bef9$1kge2$1@dont-email.me> (permalink)
References <1096dro$dnbv$1@dont-email.me> <1097uu1$5fpj$1@dont-email.me> <1098mq8$vpbo$1@dont-email.me> <1098smr$5fpj$4@dont-email.me> <10998km$141qv$1@dont-email.me>

Cross-posted to 3 groups.

Show all headers | View raw


On 2025-09-03 13:26, R.Wieser wrote:
> J.P. ,
> 
>> But I don't know - if the "Start in" field is not filled in, does the
>> shortcut [or, perhaps more accurately, whatever's processing it]
>> assume it is in some prefefined location, such as %windows%\system32
>> or something like that, rather than where the shortcut actually is?
> 
> Using IShellLink to create the shortcut I get the root-of-roots, the desktop
> folder.  And I can't edit the shortcuts target and working-directory
> properties anymore (the fields are grayed out).  Why ?  Good question.
> 

The per-user Desktop is only the "root-of-roots" in the Windows 
95-inspired shell object model .  In the real NT-based operating systems 
such as Windows NT 3.x, Windows 2000 or Windows 11, the root-of-roots is 
the empty root of the NT kernel object naming system, which contains a 
folder named "\??" with symlinks like "\??\C:" This root is only 
accessible using the low level NTDLL.DLL APIs and the driver programming 
kernel APIs, such as ZwCreateFile() etc.

>>> If the shortcut icon uses an absolute path, then it can be copied
>>> or moved anywhere.
>>
>> Yes, but that's not "relative".
> 
> Indeed.  Paul just tried to tell me why using an absolute path is the best
> idea ever and I should not want anything else.
> 
>> R didn't say _why_ he wanted "relative shortcuts":
> 
> :-)  You even quoted the reason in your post ! :
> 
> [quote=me, initial post]
> (for use on a removable USB harddisk)
> [/quote]
> 
>> all I could think of was that he wanted to be able to move/copy an entire
>> structure - shortcuts and targets - to a different location (say, another
>> machine, or a memory stick or external drive which might have a
>> different letter at times).
> 
> Or move to another location on the same drive, or to another drive on the
> same 'puter.  All examples where relative shortcuts would be usefull.
> 
> Regards,
> Rudy Wieser
> 
> 

One thing to consider is that removable hard drives can be formatted 
with almost any OS supported file system, including the NTFS version 
used for Windows NT 6.0x (Vista/Win7/Win8/Win8.1 for x=0/1/2/3), which 
happens to support relative file system symlinks, but subject to the 
arbitrary rule that to create an on-disk NTFS symlink, a user needs the 
special privilege to create kernel namespace symlinks such as "\??\C:" .

Significantly older NTFS versions only supported absolute symlinks in 
the form of "junctions", which were stored on disk in terms of the 
kernel namespace name of the drive containing the target directory 
(junctions cannot link to files), but I don't remember the exact cut-off 
OS version that introduced general NTFS symlinks, which may be different
from the version that added mklink and other UI support.


   Enjoy

   Jakob

-- 
Jakob Bohm, MSc.Eng., I speak only for myself, not my company
This public discussion message is non-binding and may contain errors
All trademarks and other things belong to their owners, if any.

Back to comp.os.ms-windows.programmer.win32 | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-02 11:36 +0200
  Re: How to create a relative shortcut ? Schugo <schugo@schugo.de> - 2025-09-02 17:41 +0200
    Re: How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-02 18:39 +0200
  Re: How to create a relative shortcut ? Schugo <schugo@schugo.de> - 2025-09-02 17:50 +0200
  Re: How to create a relative shortcut ? "J. P. Gilliver" <G6JPG@255soft.uk> - 2025-09-03 00:34 +0100
    Re: How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-03 08:15 +0200
    Re: How to create a relative shortcut ? Paul <nospam@needed.invalid> - 2025-09-03 02:21 -0400
      Re: How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-03 09:47 +0200
        Re: How to create a relative shortcut ? Paul <nospam@needed.invalid> - 2025-09-03 09:17 -0400
          Re: How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-03 16:35 +0200
            Re: How to create a relative shortcut ? Schugo <schugo@schugo.de> - 2025-09-03 16:49 +0200
              Re: How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-03 19:19 +0200
                Re: How to create a relative shortcut ? Schugo <schugo@schugo.de> - 2025-09-03 21:32 +0200
                Re: How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-04 07:59 +0200
          Re: How to create a relative shortcut ? "J. P. Gilliver" <G6JPG@255soft.uk> - 2025-09-04 02:04 +0100
      Re: How to create a relative shortcut ? "J. P. Gilliver" <G6JPG@255soft.uk> - 2025-09-03 09:02 +0100
        Re: How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-03 13:26 +0200
          Re: How to create a relative shortcut ? Jakob Bohm <egenagwemdimtapsar@jbohm.dk> - 2025-09-04 09:17 +0200
            Re: How to create a relative shortcut ? malxau <address@is.invalid> - 2026-03-22 17:50 +0000
  Re: How to create a relative shortcut ? Udo Steinbach <trashcan@udoline.de> - 2025-09-03 20:38 +0200
    Re: How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-03 21:22 +0200
      Re: How to create a relative shortcut ? Schugo <schugo@schugo.de> - 2025-09-03 22:52 +0200
        Re: How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-04 09:02 +0200
          Re: How to create a relative shortcut ? Schugo <schugo@schugo.de> - 2025-09-04 15:39 +0200
            Re: How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-04 16:11 +0200
              Re: How to create a relative shortcut ? Schugo <schugo@schugo.de> - 2025-09-04 16:26 +0200
                Re: How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-04 17:32 +0200
            Re: How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-05 09:34 +0200
              Re: How to create a relative shortcut ? Schugo <schugo@schugo.de> - 2025-09-05 15:54 +0200
                Re: How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-05 17:05 +0200
                Re: How to create a relative shortcut ? Schugo <schugo@schugo.de> - 2025-09-05 17:31 +0200
                Re: How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-05 18:09 +0200
          Re: How to create a relative shortcut ? Schugo <schugo@schugo.de> - 2025-09-04 15:57 +0200
    Re: How to create a relative shortcut ? JJ <jj4public@outlook.com> - 2025-09-04 03:03 +0700
  Re: How to create a relative shortcut ? Schugo <schugo@schugo.de> - 2025-09-03 21:54 +0200
    Re: How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-04 08:22 +0200
      Re: How to create a relative shortcut ? Jakob Bohm <egenagwemdimtapsar@jbohm.dk> - 2025-09-04 10:19 +0200
  Re: How to create a relative shortcut ? JJ <jj4public@outlook.com> - 2025-09-04 03:01 +0700
    Re: How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-04 08:50 +0200
  Re: How to create a relative shortcut ? Zaidy036 <Zaidy036@air.isp.spam> - 2025-09-03 22:00 -0400
    Re: How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-04 09:16 +0200
  Re: How to create a relative shortcut ? "R.Wieser" <address@is.invalid> - 2025-09-05 21:05 +0200
    Re: How to create a relative shortcut ? Schugo <schugo@schugo.de> - 2025-09-06 18:58 +0200

csiph-web