Windows – win xp – permanently map a network drives from command line

command linefile-sharingnetwork-shareswindows xpwindows-registry

I can open "My Computer"..tools..map network drive. Check "Reconnect at logon". And it is permanent. But I may want to clear the shares, and create them quickly. So I want to automatically do a few, so I want a fast way of doing it.
I suppose I could write a batch and have it load with the command prompt.
Lines like
net use V: \\compg\dir
But I want the network shares to load automatically when windows starts. I could put the bat in startup folder, but I don't want a command prompt opening up on every windows restart.

I was hoping there might be a command to do it so it is permanent. or perhaps a windows scripting method..

What are my options? I'm interested in what ways this can be done.

Best Answer

net use V: \\compg\dir /persistent:yes

is what you are looking for. Same as checking the "Connect automatically at boot" check box.

Also, net use /delete v: to remove it

Related Question