- How to auto-release file locks on NT/WIN2K server?

D

Dave Patrick

From a command prompt;
net pause server
net sess /d /y
'will disconnect all users
'run your backup
net continue server


--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| To facilitate scheduled updates, I wrote a small batch file that simply
| replaces certain application files on the server (NT4/WIN2K). Everything
| works fine and the files get updated as long as no one has them opened
| (these are network shared files and anyone in the company could be using
| them).
|
| Is there a way to make sure that the files that need to be replaced are
| released by the operating system (no mater who is using them, just release
| the locks) for the update to go through? In particular, I need something
| that I could use to auto-release locks on specific files (some sort of
batch
| script). Any idea how this should look like?
|
|
 
S

S>B>S

To facilitate scheduled updates, I wrote a small batch file that simply
replaces certain application files on the server (NT4/WIN2K). Everything
works fine and the files get updated as long as no one has them opened
(these are network shared files and anyone in the company could be using
them).

Is there a way to make sure that the files that need to be replaced are
released by the operating system (no mater who is using them, just release
the locks) for the update to go through? In particular, I need something
that I could use to auto-release locks on specific files (some sort of batch
script). Any idea how this should look like?
 
D

Dave Patrick

This may help.

http://www.sysinternals.com/ntw2k/freeware/psfile.shtml

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Disconnecting all the users and pausing the server is not an option since
it
| supports 24/7-type operations. What I really need is to release locks on
| specific files only, is that possible?
|
| For instance:
| :::::::::::::::::::::::::::::::::::::
| set srcdir= "\\server\UPDATES\"
| set destdir="\\server\APPFILES\"
| for each file in srcdir
| do(
| If file with the same name exists in destdir(
| release all locks
| )
| copy
| )
 
S

S>B>S

Disconnecting all the users and pausing the server is not an option since it
supports 24/7-type operations. What I really need is to release locks on
specific files only, is that possible?

For instance:
:::::::::::::::::::::::::::::::::::::
set srcdir= "\\server\UPDATES\"
set destdir="\\server\APPFILES\"
for each file in srcdir
do(
If file with the same name exists in destdir(
release all locks
)
copy
)
:::::::::::::::::::::::::::::::::::::
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top