Link to home
Start Free TrialLog in
Avatar of HaldunIT
HaldunIT

asked on

How to Automatically CLOSED an open shared file.

I was wondering if there a way to automatically close out an open shared file on a server running Windows 20303 Server? either some scripts, settings or any shareware or 3rd party tool to do this? Once a week, there's a need to do an update to the file and sometimes a user will have it open and forgot to close it out.  I know that I can do it manuall through the Computer / Properties Manager / goto the Shared folders portion and manually close it out before I do the updates.  I like to find a way to setup a task to do this automatically for me.  Any advised will me appreciated.
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

http://technet.microsoft.com/en-us/library/cc732037.aspx

looks like you can setup a batch to call net file
you can use the following commands and use them in a script to automate the process.

1. net file <ID> /close
2. net file myfile_id /close

for more detail, please see the TechNET link below

http://technet.microsoft.com/en-us/library/cc732037.aspx
ASKER CERTIFIED SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of HaldunIT
HaldunIT

ASKER

Thanks Niaz and Ged325.
I got one question ged325.  On the batch file.
where is eof?
Do you need the EOF Lable since it's telling it GOTO?
Let me know and I will try it.
Thanks,
nope.  EOF means end of file which is apparently exit out.  Tried it on my own server at work to verify (had the same question).

thanks ged325.  It works great.  Thanks for the help :)
Very fast response and helpful hints.  thanks