title: Represent a `Path` starting with a `\` but without a disk drive, under Windows
body: <p>I do not own a Windows copy, but would like to know the behavior and recommended usage in Java for representing a path such as <code>\autoexec.bat</code> under Windows?</p>
  
  <p>Semantically, such a path would represent the file <code>autoexec.bat</code> on the root of any file system. Thus it would need to be resolved against a path representing a disk drive (such as <code>C:\</code>) before representing a file. In that sense, it is not <a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/nio/file/Path.html#isAbsolute()" rel="nofollow noreferrer">absolute</a>. However, it also does not have a root component, I suppose.</p>
  
  <p>Can such path be created when running the JVM on Windows? If so, what would <code>getRoot()</code> and <code>isAbsolute()</code> return?</p>
  
  <p>I tried the following code using <a href="https://github.com/marschall/memoryfilesystem" rel="nofollow noreferrer">Memory File System</a>, but this throws <code>InvalidPathException</code>: “path must not start with separator at index 1: \truc”. Does this faithfully reflect the behavior under Windows, or is it a quirk of this specific library?</p>
  
  <pre><code>try (FileSystem fs = MemoryFileSystemBuilder.newWindows().build()) {
      final Path truc = fs.getPath("\\truc");
      LOGGER.info("Root: {}.", truc.getRoot());
      LOGGER.info("Abs: {}.", truc.isAbsolute());
      LOGGER.info("Abs: {}.", truc.toAbsolutePath());
  }
  </code></pre>
  
  <p>Such paths are valid in the Windows terminal, or at least they were last time I used Windows (a long time ago). It would be handy to create such path in order to mark that the path is “absolute” (in the sense of starting with a backslash, thus not relative to a folder), but still leave the path without a driver letter specified. Then such a path can be (later) resolved to <code>C:\autoexec.bat</code> or <code>D:\autoexec.bat</code> or …</p>