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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Folders share removal and re-creation

Status
Not open for further replies.

rob4465

IS-IT--Management
Sep 26, 2004
2
GB
I wonder if anyone can assist me with this?

I have a paradox database that exists in a folder share on one of my servers. I'm finding that I need to clear down the lock and net files every morning to prevent user problems later in the day.

I've been doing this physically by going into the server, removing the share and deleting any stray lock and net files.

Recently I've tried the same process with a batch file running on a scheduled task (below):

:: Remove the RDB share
net share D:\RDB /delete /Y
:::::::::::::::::::::::::::::::::::::::
:: Removal of Lock and Net files
ECHO Y | DEL D:\RDB\RDB\*.net
ECHO Y | DEL D:\RDB\RDB\*.lck
:::::::::::::::::::::::::::::::::::::::
:: Recreate the RDB share
net share RDB=D:\RDB /GRANT:EVERYONE,FULL

This doesn't seem to work very satisfactorily and I was wondering whether there is a better VbScript I could use to accomplish this.

The process, as is in the batch file I need is removing the share, deleting the lck, net files and then re-creating the share with the EVERYONE attribute having Full control permission.

I'd be grateful if anyone has a better solution / suggestion.

Thanks very much for your help.


 
Suggestion:
There's got to be a reason why this is happening. I would refocus my energiesto finding the reason as opposed to developing a work-around script.

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top