Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a problem in Shared Folders

Status
Not open for further replies.

netwalker1

Programmer
Feb 5, 2000
1,241
EG

We have Windows 2000 Server with cluster mode ..
When we restart the server , the shared folders become unshared , and I must create the share again ..

Any Idea how can I solve this problem ?

Mohamed Farid
[green]Know Me No Pain , No Me Know Pain !!![/green]
 
To clarify, rebooting server casues folders to no longer be shared?

We are talking about shared folders and not mapped drives, yeah?


Chris


ChrisCj21
MCSE, A+, N+
 
yeah ..
rebooting server casues folders to no longer be shared ..


Mohamed Farid
[green]Know Me No Pain , No Me Know Pain !!![/green]
 
hmmm

Sorry not too sure then - if ever I have an issue similar to this i would add a startup script for the server to check folder status and share if not already shared.

Code:
'check if foldershare exists, delete if so


strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colShares = objWMIService.ExecQuery _
    ("Select * from Win32_Share Where Name = 'example'")
For Each objShare in colShares
    objShare.Delete
Next

'now share is removed add new

'permissions
Const FILE_SHARE = 0

'max connections
Const MAXIMUM_CONNECTIONS = 25


strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" _
    & strComputer & "\root\cimv2")


Set objNewShare = objWMIService.Get("Win32_Share")



errReturn = objNewShare.Create _
    ("C:\PATH_TO_THE_FOLDER", "SHARE_NAME", FILE_SHARE, _
        MAXIMUM_CONNECTIONS, "SHARE_COMMENT")



hth


Chris


ChrisCj21
MCSE, A+, N+
 
Wow ...
I will give it a try then I will Star you if it works ...


Mohamed Farid
[green]Know Me No Pain , No Me Know Pain !!![/green]
 
You will obviously have to alter file paths etc but works....

I use it for an unattended CD i created



Chris


ChrisCj21
MCSE, A+, N+
 
Are you creating the shares using Cluster Manager?
 
No . I made them by Windows Explorer ..

Mohamed Farid
[green]Know Me No Pain , No Me Know Pain !!![/green]
 
you can create the shared folder using Cluster Manager,that can resolve this problem.
 
This problem will not be resolved because the Shared folders are not only on the Shared resources ,, also the shared folders are located in the local partations of the servers ...


Mohamed Farid
[green]Know Me No Pain , No Me Know Pain !!![/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top