I want a batch file to copy two files. I want to placed an updated copy of the 'hosts' and 'lmhosts.sam' files to the c:Windows\System32\drivers\etc\ directory. The lmhosts.sam file will copy fine. However the batch file returns an 'access denied' error when copying the hosts file. Below is the batch file and the batch file output. Is there a way to overwrite the hosts file?
xcopy hosts C:\Windows\System32\drivers\etc\ /Y
xcopy lmhosts.sam c:Windows\System32\drivers\etc\ /Y
ECHO is on.
C:\Install>xcopy hosts C:\Windows\System32\drivers\etc\ /Y
C:\Install>xcopy lmhosts.sam c:Windows\System32\drivers\etc\ /Y
1 File(s) copied