Computing.Net > Forums > Windows Server 2003 > Script to share and unshare a file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Script to share and unshare a file

Reply to Message Icon

Name: hjxfabio
Date: June 22, 2006 at 20:46:36 Pacific
OS: Windows 2003 Server
CPU/Ram: 2.8/1gb
Product: dell
Comment:

Hello everyone, my situation is as follows. I have an updating program to update a file every night. That file is in local harddisk, but is shared to the network users. I would like to write a script to unshare the file, then run the update program, then share the file again. Are there any scripts to do that? Please advice, thanks.



Sponsored Link
Ads by Google

Response Number 1
Name: heropsycho2177
Date: June 23, 2006 at 05:20:12 Pacific
Reply:

Just make batch files using net share and net share /delete commands.

"Milk was a bad choice!"


0

Response Number 2
Name: racoonracer
Date: June 25, 2006 at 00:46:43 Pacific
Reply:

how about setting a scheduled task to backup the one file at say 4:43am in the morning?

Use my bad advices at your own peril!


0

Response Number 3
Name: hjxfabio
Date: June 27, 2006 at 07:11:08 Pacific
Reply:

heropsycho2177: Thanks, it works. :)
racoonracer: Tried this method. Actually it's an access database file, whereby a few people will be using. The task was to repair and compact the file. However, I keep getting an error that the file is being locked by one of the users, which the user has already off his PC.


0

Response Number 4
Name: heropsycho2177
Date: June 27, 2006 at 07:17:05 Pacific
Reply:

Woot, woot, woot! *in best Teen Girl Squad voice*

"Milk was a bad choice!"


0

Response Number 5
Name: racoonracer
Date: June 27, 2006 at 08:31:52 Pacific
Reply:

HAHAHHAAHAAAA!!!!

Next time then.


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows Server 2003 Forum Home


Sponsored links

Ads by Google


Results for: Script to share and unshare a file

Batch script to move/delete files www.computing.net/answers/windows-2003/batch-script-to-movedelete-files/6453.html

permissons to rename but not delete www.computing.net/answers/windows-2003/permissons-to-rename-but-not-delete/7242.html

write a script to delete files 7 da www.computing.net/answers/windows-2003/write-a-script-to-delete-files-7-da/8492.html