Discussion Locked

Changing Drive letters and Shares

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a server that I need to change the drive letter for the storage drive (e:) to drive d:. It has all of our user$ shares and a few others. Am I correct in my assumption that when you change the drive letter within windows 2000, all the shareswill go away and you have to re-create them by hand? Is there a way to automate the "re-sharing" process?

Thanks in advance for any help with this. It could save me a few hours this weekend.

Ford Wilkinson
rfwilkinson@hotmail.com

6 replies

by "doctor"

You can write a batch file using the net share command to add and delete shares and drive letters. I am not sure you have a problem here. You do not have to lose shares when you are chanjging logical or physical drive letters.

by rfwilkinson

To clarify, I am using Windows 2000 Advanced server. I am going into Computer Management/Disk Management and right clicking on the drive I wish to change. I then select a different drive letter. When I go and look at the drive through Windows Explorer, only the Security Permissions on teh files have been retained. The actual share information has been lost. I am not sure what you mean by "You do not have to lose shares when you are chanjging logical or physical drive letters." If you could clarify this I would appreciate it.

by rfwilkinson

Just to add... I have tested this on our test network and when I go into Compter Management/Disk Management, Right click on the drive letter and change the letter of the drive, then go to that drive through my computer, the shares are GONE. This is my problem and I am not sure what you mean by "You do not have to lose shares when you are changing logical or physical drive letters." I have tested this several times with the same outcome -- the share information disappears.

by timthetoolman

Hi,

The Doctor was right in that you can use the net share command to add the shares back in. Type...

net share >> shares.txt

at a command prompt to get a listing of all the shares on the machine in the file shares.txt

Then using a macroin word, manipulate the contents of the file to create a batch file to re-add them.

An example might be

net share fred$=D:\users\fred

Typing "net share /?" gives...

E:\Documents and Settings\Tim Medhurst>net share /?
The syntax of this command is:

NET SHARE
sharename
sharename=drive:path [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Documents| Programs | None ]
sharename [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Documents | Programs | None]
{sharename | devicename | drive:path} /DELETE

...for all the options, and using the appropriate one will allow to to re-add them in batch the way you need them...

Hope that helps for this weekend.
Cheers,
Tim.

This discussion is closed to new replies.