File 通过批处理脚本操作另一台计算机上的文件
我想从我的计算机连接到另一台计算机。 然后我想从这台计算机上访问一个文件,复制并删除这个文件 这是我的批处理脚本,但它不起作用:File 通过批处理脚本操作另一台计算机上的文件,file,batch-file,cmd,File,Batch File,Cmd,我想从我的计算机连接到另一台计算机。 然后我想从这台计算机上访问一个文件,复制并删除这个文件 这是我的批处理脚本,但它不起作用: net use X: \\computer2 passwordOfComputer2 /u:computer2\admin copy "X:\Users\admin\AppData\Roaming\myfile.txt" "X:\Users\admin\AppData\Roaming\myfile.txt.old" del "X:\Users\admin\AppDat
net use X: \\computer2 passwordOfComputer2 /u:computer2\admin
copy "X:\Users\admin\AppData\Roaming\myfile.txt" "X:\Users\admin\AppData\Roaming\myfile.txt.old"
del "X:\Users\admin\AppData\Roaming\myfile.txt"
pause
我有系统错误53
你能帮帮我吗?你为什么认为你可以编命令呢
请参阅
runas/?
要了解错误消息53是什么,请使用net helpmsg 53
-它告诉您未找到网络路径。
原因是您没有指定共享,只指定了计算机名
其他小的调整只是重命名,而不是复制/删除-这将大大加快大型文件
net use X: \\computer2\c$ passwordOfComputer2 /u:computer2\admin
ren "X:\Users\admin\AppData\Roaming\myfile.txt" "myfile.txt.old"
pause
检查工具该工具允许您在远程计算机上执行命令-
WMIC进程
,WINRS
,PSEXEC
,xCMD
。这些命令是有效的,它们没有使用runas-confused,因为不需要映射驱动器。您可以直接执行,如果存在安全问题,runas将克服它。命令是不正确的,因为为什么要纠正错误的方法。最简单的move“\\computer2\X$\Users\admin\AppData\Roaming\myfile.txt”\\computer2\X$\Users\admin\AppData\Roaming\myfile.txt.old”