This code does not ensure we have an absolute path with a drive letter for `id`.  If passed a relative path or an absolute path without a drive letter, this code will end up stripping off the first directory component.  I would suggest that `id` should be canonicalised before stripping for safety.