Search Tools Links Login

SUBST


Substitute a drive letter for a network or local path.  This comes in handy when you want to reference a directory which may have a really long path by a drive letter.

For example, instead of using 

c:\TopLevelFolder\NextLevelFolder\ThirdLevelFolder\AlmostThere\FinallyAtMyDestination

you could reference it by a drive letter, say, X:.  To do this, just use the command:

SUBS X: c:\TopLevelFolder\NextLevelFolder\ThirdLevelFolder\AlmostThere\FinallyAtMyDestination\

I've included the help file below for SUBST.  Hope this helps someone out there!

Syntax

SUBST drive_letter: path

SUBST 

SUBST drive_letter: /D

Key

SUBST with no parameters will display current SUBST drives

/D : Delete the drive_letter substitution.Compared to mapping a drive with NET USE the SUBST command allows mapping to a subfolder of a drive share - for the storage of user profiles this reduces the number of shares you need to create on the server.

Bugs

Under NT 4 SUBST''ed drives cannot be disconnected using the Explorer GUI - this was fixed in Windows 2000.

In Windows 2000 (and above) you will have problems creating, accessing and deleting drive mappings with SUBST. 

However under Win 2K/XP the functionality of the NET USE command is improved so you can now do 
NET USE g: \\server\share\folder1\folder2

If the network resource is unavailable (ie the server is down) SUBST will continually retry - unlike NET USE which will try to connect once and fail - depending on your application this may be a good or a bad thing - a subst drive that is not available will badly impact performance of most applications.

Notice that when SUBST is used against a local shared folder, it will create a RECYCLER for that drive. The RECYCLER is not removed when the drive substitution is removed, but can be deleted manually.

About this post

Posted: 2007-04-25
By: FortyPoundHead
Viewed: 3,497 times

Categories

Windows Commandline

Windows

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.