NET commands and DOS SUBST

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15729
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

NET commands and DOS SUBST

Post by ChrisGreaves »

I have discovered the /Delete of the SUBST command, to my delight, for I use SUBST to map a slew of drive letters to folders (attached Fakes.BAT.txt)
Map a Folder to a Drive Letter for Quick and Easy Access • Raymond.CC.htm has saved me an hour or so of struggling to master the Net Use command. Indeed by working through the GUI examples I came to get the command line methods work well. :clapping:

Mapping a network drive without hardcoding a drive letter in a batch file - Stack Overflow is worth reading too. I like the idea of anonymous drive letters, but have not yet experimented. E.g. “The batch file contains a function freedrive, which finds a free drive letter and returns it in a variable. It also correctly detects optical drives that have no media as occupying a drive letter
The PushD and PopD commands intrigue me. I miss the old DOS pushdir.com and popdir.com utilities.

I am having a Good Day today and could tolerate a bit of friendly criticism(grin). I recall some five or so years back being mildly commented on for my continued use of the SUBST command rather that the then new-fangled NET commands. My guess is that I missed a slash or the $ sign in the NET USE command and had more interesting things to worry about. Also I hate being shown to be wrong.

But if someone can come up with a rational argument for “NET USE” over “SUBST” I will devote some time to conversion. Honest!
I suspect that the discussion back then arose during one of those rare $1,000/day episodes in my working life, and writing VBA was more important than switching to a new NET way of mapping drives when the old DOS way worked for me. I am still a devotee of BATCH files. Or Script files if I ever get around to them ...(grin)

(later) It may well be that the SUBST method of assigning drive letters is causing Windows to be sluggish in presenting folder contents in Explorer. My DOS SUBST commands map to folders on drive T: which is itself mapped via TrueCrypt onto an encrypted partition of \Device\Hardisk0\Partition2. C.
You do not have the required permissions to view the files attached to this post.
By definition, educating the client is the consultant’s first objective