# Sharing violation



## tofpic (Aug 6, 2008)

Hi, 

I was trying the following script after picking and using from the other suggestions:

echo "Wait, while I copy your D drive ..."
Echo. >>d_backup_log.txt
echo.---------------------------------- >>d_backup_log.txt
echo %date% %time% >>d_backup_log.txt
echo.---------------------------------- >>d_backup_log.txt
Echo. >>d_backup_log.txt

xcopy d:\ H:\d_backup /e /i /y /d >>d_backup_log.txt
echo "copying completed ...

Now it works until it tries to copy D:\Documents and Settings\user\NTUSER.DAT

When it gets there it says Sharing Violation and quits immediately

What is wrong, what must I do?


----------



## Squashman (Apr 4, 2003)

The file is in use. You can't copy files in use with a batch file.


----------



## tofpic (Aug 6, 2008)

Hi,

I will use the exclude parameter and exclude that file. It is not a user generated file anyways. The aim is to backup the files and folders I have created in my laptop to my network folder.

Thanks.


----------

