When the Server Service receives a request for a file that is already open, it may receive a sharing violation. The Server Service then waits before retrying the operation a number of times.

NOTE: This behavior is readily apprent with any multi-user, file-based application, such as the Jet database engine that has shared database files.

Using REG.EXE on Windows 2000, from the Windows 2000 Support Tools, or REG.EXE built into Windows XP, Windows Server 2003, and later operating systems, AND PsShutdown.exe, I have scripted NTOptOff.bat to resolve this behavior.

The syntax for using NTOptOff.bat is:

NTOptOff \[R\]

Where the optional parameter R will restart your computer.

NOTE: A restart is required for these settings to become effective.

NOTE: See How can I improve Access or Jet database performance on Windows Server 2003?

NTOptOff.bat contains:

@echo off
setlocal
set sd=%1
set key="HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters"
call :quiet>nul 2>&1
if /i \{%sd%\} NEQ \{R\} endlocal&goto :EOF
endlocal
PsShutdown -r -f
:quiet
reg add %key% /V SharingViolationDelay /T REG_DWORD /F /D 0
reg add %key% /V SharingViolationRetries /T REG_DWORD /F /D 0