myfootsmells
asked on
cmd line command to kill open files on a server?
Is there some command line command to kill all connections to an open file on a server?
myfootsmells
myfootsmells
ASKER
There isn't a way for me to close a specific file?
Yes I understand that, but there are certain files that need to be altered at midnight and if users have that file open, well it doesnt work :)
myfootsmells
Yes I understand that, but there are certain files that need to be altered at midnight and if users have that file open, well it doesnt work :)
myfootsmells
Another thing you could do is script the deletion and creation of the share. For example:
net share sharename /delete
net share sharename X:\PATH
There are additional commands - run net share on a system to get help for the command.
You might find these interesting:
http://groups.google.com/groups?q=Windows+close+open+files+script&hl=en&lr=&ie=UTF-8&selm=3BB98F58.3B8BDD9E%40hydro.com&rnum=5
also
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=8akio0%24b9l%241%40ssauraab-i-1.production.compuserve.com&rnum=8&prev=/groups%3Fq%3DWindows%2Bclose%2Bopen%2Bfiles%2Bscript%26hl%3Den%26lr%3D%26ie%3DUTF-8%26selm%3D8akio0%2524b9l%25241%2540ssauraab-i-1.production.compuserve.com%26rnum%3D8
net share sharename /delete
net share sharename X:\PATH
There are additional commands - run net share on a system to get help for the command.
You might find these interesting:
http://groups.google.com/groups?q=Windows+close+open+files+script&hl=en&lr=&ie=UTF-8&selm=3BB98F58.3B8BDD9E%40hydro.com&rnum=5
also
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=8akio0%24b9l%241%40ssauraab-i-1.production.compuserve.com&rnum=8&prev=/groups%3Fq%3DWindows%2Bclose%2Bopen%2Bfiles%2Bscript%26hl%3Den%26lr%3D%26ie%3DUTF-8%26selm%3D8akio0%2524b9l%25241%2540ssauraab-i-1.production.compuserve.com%26rnum%3D8
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try this.. This could be useful....
http://www.sysinternals.com/ntw2k/freeware/pstools.shtml
http://www.sysinternals.com/files/Pstools.zip
http://www.sysinternals.com/ntw2k/freeware/pstools.shtml
http://www.sysinternals.com/files/Pstools.zip
net stop server
will stop the server serrvice and cut off everyone connected.
A quick way to do this is to type the following on a command line:
net stop server & net start server
The above line will both stop and then restart the server service in as quick a time as possible.
You do realize, you'll end up potentially screwing up peoples files if you close open connections...