Our community dashboard tracks activity and engagement from community members across a wide variety of sources, including, the DNN forum, Twitter, GitHub, StackOverflow, etc.
Go to previous topic
Go to next topic
Last Post 04 Feb 2022 08:53 PM by
Map OneDrive to a drive letter
Most Recent First
You are not authorized to post a reply.
04 Feb 2022 08:53 PM
To permanently map OneDrive to a drive letter, you first need to go to the Apps folder in Windows File Explorer. Then you need to create a new text document with one line of text. The file also needs to use the .bat extension.
Right-click the file and choose edit.
Then type subst z: “c:/Users/mark/OneDrive – Personal into the file and save it.
Then double-click it to run the file and map OneDrive to the drive letter.
The, click on the Windows Key and R key to open the run command box. Then type shell:startup and click ok. It will take you the Windows Startup Folder. Right-click and choose to create a shortcut. Then choose the batch file. Putting the batch file in the startup folder will permanently map OneDrive to the drive letter.
Previously, we outlined a method for mapping a drive letter to Microsoft OneDrive using the old “subst” DOS command. This trick was needed because neither Windows 10 nor Windows 11 will allow users to map OneDrive through conventional methods. While the use of a DOS command is effective, it is not permanent. Each restart or reboot of your PC will remove the mapping, so we must take the next step to make it constant.
In the days of DOS we could make our mapped drive permanent through an autoexec.bat file that runs during the boot process, but that will not work with Windows 10 or Windows 11. However, we can still use a batch file to run our subst command at startup, but only if we mix the old with the new and link the file to the right folder.
For those of you not as ancient as me, a batch file is a simple text file that Windows interprets as a series of commands. These are the kinds of commands you would issue from the standard command prompt. Probably the best way to describe it is that batch files are a form of scripting
For our purposes, we will create a simple text file with the “.bat” extension with only one line in it. It does not matter where this batch file is located, but I would suggest somewhere on the operating system drive (typically C:). For our example, we will use C:\Apps.
Use Windows File Explorer to navigate to the Apps folder, as shown in Figure A, and right-click on an open area in the righthand window. Select New | Text Document from the context menu.
Give your new text file a name but be sure to use the .bat extension. For our example, we used Startup.bat.
Right-click your batch file and select Edit from the context menu. Windows will open Notepad, and you will see an empty text file. Add the subst command that maps your desired drive letter to Microsoft One Drive. In my case it is:
subst z: “c:/Users/mark/OneDrive – Mark W Kaelin”
Save the batch file and close out Notepad. If you double-click your new batch file, it will run (probably faster than you can notice) and OneDrive will be mapped to a drive letter. However, to get this batch file to run on startup, we will have to place a link to it in the special Windows 10 and Windows 11 Startup folder.
Many users are unaware of the Windows Startup folder, but it can be useful for running any application during the boot process that does not have that feature already built in. To reach it, use the keyboard combination shortcut Windows Key + R to open the run command dialog box and type “shell:startup”, as shown in Figure C.
Click OK to open a session of File Explorer pointing to the Windows Startup folder, as shown in Figure D. Right-click an open area in the righthand window and select New | Shortcut. You will be presented with a dialog box where you can browse to your batch file.
Browse to where you stored your batch file (Figure E). When you find the file, click on it, and then click the OK button. Click Next and then Finish. Close out File Explorer when you are done.
Now, when you look at the Windows Startup folder, you will see a link to your batch file. As long as that shortcut is in the Windows Startup folder, Microsoft OneDrive will be mapped to a specific drive letter according to your preferences when you boot your PC.
You are not authorized to post a reply.
--Vigilant MSP Program
--Small Office/Home Office (SOHO...
Web Publishing Services