Easy methods to map OneDrive to a drive letter in Home windows 11

With an replace to Microsoft Home windows 11, you’ll be able to not simply map OneDrive to a drive letter. As an alternative, you will need to resort to the traditional command line system generally known as DOS.

Picture: Cherry b l o s s o m/Shutterstock

Over the previous few years, TechRepublic has revealed a number of articles displaying you tips and ideas that permit you to designate a selected drive letter to Microsoft OneDrive. This was obligatory as a result of Microsoft not permits it utilizing typical strategies. Properly now, a reader has knowledgeable us that with the replace to Home windows 11, a kind of tips has develop into out of date. So, we should discover one other method.

As soon as upon a time, lengthy earlier than Home windows and graphical person interfaces, private computer systems have been run from the command line utilizing DOS. Lots of these historical legacy instructions are nonetheless viable, even in Home windows 11. That is the place we are going to discover the instructions we have to designate a selected drive letter to Microsoft OneDrive.

SEE: 3 must-have calculator instruments for the tech skilled (TechRepublic Premium)

Easy methods to map OneDrive to a drive letter in Home windows 11

Earlier than we start, a few of chances are you’ll be questioning why you’ll wish to give OneDrive a drive letter within the first place. I realized a very long time in the past that in terms of how folks use their PCs, it’s best to glide and assume there’s a good cause.

On this case, a reader requested for assist after discovering {that a} earlier tip not labored. So, we’re serving to to unravel the issue the very best we are able to. That stated, what when you have been writing a script in PowerShell that referenced OneDrive? Utilizing a drive letter as shorthand for a selected OneDrive folder might turn out to be useful.

SEE: Easy methods to roll again Home windows 11 and return to Home windows 10 (TechRepublic)  

The very first thing we have to do is begin our command-line session with administrative rights. In Home windows 11, click on the search icon within the taskbar and sort “cmd” into the search field. Choose Run as Administrator from the choices listing to achieve the command line window proven in Determine A.

Determine A


To perform our job, we shall be utilizing the “subst” command, which is brief for substitute. Its easy operate is to substitute a drive letter for a selected folder recognizable by the working system. The fundamental syntax seems like:

subst [: [:]]

Essentially the most troublesome a part of this trick is figuring out precisely what path your set up of Microsoft OneDrive makes use of in keeping with the working system. To do this, we should benefit from some DOS-level listing browsing.

First kind “cd/” after which kind “dir”. These are the DOS change listing and the show listing instructions respectively, and we’re altering our focus to the foundation listing (Determine B) and getting an inventory of subdirectories on the primary drive (most probably C:).

Determine B


The OneDrive listing is a subdirectory of a subdirectory of the Customers listing, so we kind “cd/Customers” on the command immediate after which request one other listing of subdirectories by typing “dir” once more, as proven in Determine C.

Determine C


Now, that is the place it will get attention-grabbing. For my PC, the person listing is called “mark” however to your PC it is going to be fully totally different. Regardless of the title, the subsequent command ought to be “cd/Customers/(fill in your listing title)”. For our instance, the instructions can be:


Your outcomes shall be just like the display proven in Determine D. Be aware, you will need to kind within the full path for the command to work. A DOS limitation.

Determine D


In our instance, the title of my OneDrive listing is named “OneDrive – Mark W Kaelin”. As you’ll be able to think about, referencing that in a script might be a nightmare. We are able to substitute a single drive letter (Z:) for that lengthy string of listing names utilizing this command:

subst z: "c:/Customers/mark/OneDrive - Mark W Kaelin"

Be aware using the citation marks. We should encompass our listing path in citation marks as a result of it incorporates areas. DOS considers areas to be a break, which suggests it expects the subsequent little bit of textual content to be a brand new command. One other DOS limitation. After all, your OneDrive listing title will totally different from mine.

In the event you now, kind “z:” into the command immediate and sort “dir” you will note your Microsoft OneDrive listed in all of its DOS glory (Determine E).

Determine E


Shut out the command-line session after which load Home windows File Explorer. If you scroll down the left-hand listing of folders, you will discover Z: on the listing of obtainable drives, as proven in Determine F.

Determine F


Sadly, this setting just isn’t everlasting. The subsequent time your PC is restarted, this substitution shall be misplaced and must be reapplied. If you wish to completely designate a drive letter to Microsoft OneDrive even throughout a restart, you’ll have to resort to a different historical method generally known as the autoexec batch file, which is a few deep DOS voodoo requiring its personal separate article.

Additionally see