运行批处理文件以复制文件时访问被拒绝错误

时间:2022-11-22 02:09:00
echo off
copy "\\192.168.7.10\C$\Documents and Settings\Administrator\Desktop\ABC\Detail.csv" \\192.168.7.20\C$\Users\Administrator\Desktop\Book\"     
if "%errorlevel%"=="0" set /A a=1
if "%errorlevel%"=="1"  set /A a=0 
if %a%==1 Echo copy successful  
if %a%==0 Echo Failed to copy 
 PAUSE
Exit

Please suggest why this error persists while i am running batch script

请在我运行批处理脚本时建议为什么此错误仍然存​​在

1 个解决方案

#1


1  

This error persists either because you have no permission to read from "\\192.168.7.10\C$\Documents and Settings\Administrator\Desktop\ABC\Detail.csv" or because you have no permission to write to \\192.168.7.20\C$\Users\Administrator\Desktop\Book\.

此错误仍然存​​在,因为您无权读取“\\ 192.168.7.10 \ C $ \ Documents and Settings \ Administrator \ Desktop \ ABC \ Detail.csv”或因为您无权写入\\ 192.168.7.20 \ C $ \用户\管理员\桌面\书\。

Also you have a superfluous double quote at the end of \\192.168.7.20\C$\Users\Administrator\Desktop\Book\.

另外,你在\\ 192.168.7.20 \ C $ \ Users \ Administrator \ Desktop \ Book \的末尾有一个多余的双引号。

#1


1  

This error persists either because you have no permission to read from "\\192.168.7.10\C$\Documents and Settings\Administrator\Desktop\ABC\Detail.csv" or because you have no permission to write to \\192.168.7.20\C$\Users\Administrator\Desktop\Book\.

此错误仍然存​​在,因为您无权读取“\\ 192.168.7.10 \ C $ \ Documents and Settings \ Administrator \ Desktop \ ABC \ Detail.csv”或因为您无权写入\\ 192.168.7.20 \ C $ \用户\管理员\桌面\书\。

Also you have a superfluous double quote at the end of \\192.168.7.20\C$\Users\Administrator\Desktop\Book\.

另外,你在\\ 192.168.7.20 \ C $ \ Users \ Administrator \ Desktop \ Book \的末尾有一个多余的双引号。