Subst drive & folder

2.8k views Asked by At

Can I use windows command subst to map a drive & folder to another location?

I want to map say the temp folder

c:\foo\bar\temp

to

e:\buildserver\dev

I can easily map the temp directory to e: using

subst e: c:\foo\bar\temp

But how can I also add the path folding the drive \buildserver\dev

2

There are 2 answers

0
CyberDude On

You can create a directory junction like so:

mklink /J c:\foo\bar\temp\ e:\buildserver\dev\
2
Kip Bryan On

On Windows 10 and Windows 7, instead of subst e: c:\foo\bar\temp

NET USE E: "c:\foo\bar\temp"

This sticks across a reboot.