 <p>For global lock you need <a href="http://msdn.microsoft.com/en-us/library/system.threading.mutex.aspx" rel="nofollow">mutex</a></p> <pre><code> // The key can be part of the file name - // be careful not all characters are valid var mut = new Mutex(true, key); try { // Wait until it is safe to enter. mut.WaitOne(); // here you manipulate your file } finally { // Release the Mutex. mut.ReleaseMutex(); } </code></pre>