Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a windows equivalent to the old DOS SUBST command?

I want to be able to assign a local drive letter to a folder on a local drive.

I realise that a mapped drive will work (and so far that's the technique I've ended up using), but it doesn't seem to cut-in until rather late in the boot process. I've also in the past tried putting SUBST commands in batch files in the boot process, but that doesn't seem to work either.

TIA, Paolo

share|improve this question

3 Answers 3

up vote 28 down vote accepted

Good news! The subst command still works in Windows 7!

To create a new mapping:

subst x: C:\Folder\Example

To remove a mapping:

subst x: /D

share|improve this answer
Yes, I know it works, but I couldn't get it to happen automagically on boot (especially as early as possible). Do you know how that can be done? –  PaoloFCantoni Sep 13 '13 at 4:47
Have you tried making a batch file out of the above command and adding that as a startup script in gpedit.msc/Local Group Policy Editor? –  Josh R Sep 13 '13 at 4:54
Have now... I don't think I tracked that down (not being a sysadmin) when I tried it before. Seems to be the place to do it... However, using @50-3's point I may use NET USE in place of SUBST. –  PaoloFCantoni Sep 13 '13 at 5:46


net use x: \\localhost\c$\Folder\Example

The difference between net use & subst below break


When a share becomes unavailable subst will try over and over again to re-connect severely impacting performance of your PC as it tries to re-connect. This is less common when mapping local files as it will only occur if you say re-name the folders in the path. The resolution if this does occur is subst x: /d

net use

net use was introduced in win2k/xp to provide an alternative to this. When net use is used to connect to a location and that location becomes unreachable windows will report drive as disconnected and not try to re-connect until user tries to re-connect to resources on the mapped drive. This resolves the performance issues noted in subst

For more information on both commands you can query via the command line with /?

net use /? & subst /?

share|improve this answer
Normally, since the drive I want to map to is local, I'd use SUBST. However, since it's a USB connected local drive and not always available, will it trigger the problem outlined above? –  PaoloFCantoni Sep 13 '13 at 5:19
Why yes it would - however I'm not sure how you would correctly address it as a USB might not be assigned the same drive letter every time it's plugged in –  50-3 Sep 13 '13 at 5:21
Good thinking, but as it happens, I'm intending to use it on an ASUS TX300CA Windows 8 transformer tablet which has a detachable keyboard dock On the tablet part there are NO USB ports, so the BIOS must assign the keyboard dock drives (which are USB) before anything else. So they shoudl be stable. I'm sure ASUS would have sorted that. –  PaoloFCantoni Sep 13 '13 at 5:45
At least you should now have a good grasp on your options. Do us a favor and upvote @Josh his answer was high quality and answered your original questionp perfectly –  50-3 Sep 13 '13 at 5:58
NET USE simply cannot be used on my work. I'm not an admin, nor I'm allowed to share any folder. SUBST is a better option in that case. –  rsenna Nov 7 '14 at 20:22

The best way to do this across boots is to put it in the registry. Here is a snippet:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices] "X:"="\??\C:\Folder\Example"

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.