---
title: "it is being by another process when copy file from local disk to folder in domain network why"  
description: "it is being by another process when copy file from local disk to folder in domain network why"  
author: "ahmed salah"  
published: 2014-11-05  
updated: 2017-09-04  
canonical: https://www.mindstick.com/forum/2521/it-is-being-by-another-process-when-copy-file-from-local-disk-to-folder-in-domain-network-why  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# it is being by another process when copy file from local disk to folder in domain network why

Hi guys i have [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) in my [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) when i try to copy [image](https://www.mindstick.com/articles/23551/an-investigate-distinctive-seafood-restaurant-for-your-image-stamp-character) jpg from local disk in any place to network [path](https://www.mindstick.com/articles/44333/4-expert-tips-on-how-to-pick-the-right-career-path) [DOMAIN![it is being by another process when copy file from local disk to folder in domain network why](https://cdncache-a.akamaihd.net/items/it/img/arrow-10x10.png)](https://social.msdn.microsoft.com/Forums/vstudio/en-US/10882f26-d329-4560-9a1a-8b456b831684/it-is-being-by-another-process-when-copy-file-from-local-disk-to-folder-in-domain-network-why?forum=csharpgeneral#)\
it give me [error](https://yourviews.mindstick.com/view/88527/fixing-quickbooks-error-4120-reinstalling-vs-repairing) the process [cannot access](https://www.mindstick.com/forum/33726/inside-onclicklistener-i-cannot-access-a-lot-of-things-how-to-approach) the file it using by another process file\
\
why this [message](https://www.mindstick.com/forum/12802/show-confirmation-message-yes-or-no-in-asp-dot-net) show\
and how to solve.the error show in line [delete](https://www.mindstick.com/forum/33620/how-to-delete-record-from-list-in-mvc-using-ajax) of file\
**my code as below**\

```
private void button11_Click_1(object sender, EventArgs e){openFileDialog1.Title = "Insert an image ";openFileDialog1.InitialDirectory = "c:";openFileDialog1.FileName = "";openFileDialog1.Filter = "JPEG Image|*.jpg|GIF Image|*.gif|PNG Image|*.png";openFileDialog1.Multiselect = false;if (openFileDialog1.ShowDialog() != DialogResult.OK)return;      pictureBox2.ImageLocation = openFileDialog1.FileName; }private void button12_Click_4(object sender, EventArgs e){const string new_dir = "\\\\192.168.1.5\\Personal Pictures";MessageBox.Show(openFileDialog1.FileName);string extension = System.IO.Path.GetExtension(openFileDialog1.FileName);string renamed_name = textBox1.Text + "" + extension;string fName = System.IO.Path.Combine(new_dir, renamed_name);if (File.Exists(fName))File.Delete(fName);this line give errorSystem.IO.File.Copy(openFileDialog1.FileName, fName);string msg = string.Format("Copied {0} to {1}", openFileDialog1.FileName, fName);MessageBox.Show(msg, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);}
```

How to solve the error\
if possible help me\
thanks\
\

## Replies

### Reply by Corey lean

While copying files from old pc to new one, I was getting this error quite a lot. Whatever the time being, the error said the same. I didn’t knew what exactly the problem is. After searching a lot and reading blogs I found people suggesting to use GS Richcopy 360. I also tried it and it worked for me very well. It helped me a lot, using this I can also automate my file transfer. Try it, hope this comment helps someone!

### Reply by John Smith

Looks like your file being accessed by some other part of your code....


---

Original Source: https://www.mindstick.com/forum/2521/it-is-being-by-another-process-when-copy-file-from-local-disk-to-folder-in-domain-network-why

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
