PowerShell继续说找不到网络路径

时间:2017-10-13 16:15:33

标签: powershell

我创建了一个简单的PowerShell代码,可以将文件夹从一台计算机复制到另一台计算机,但我一直在找到一个未找到的网络路径"有什么我做错了吗?

# PowerShell Read-Host Input Box
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }

Clear-Host
$ComputerName1 = Read-Host "What is the name of your computer?"
$ComputerName2 = Read-Host "What is the name of the computer you are fixing?"
$Yours = $ComputerName1
$Theirs = $ComputerName2
robocopy "\\$ComputerName1\c:\Temp\Test" "\\$ComputerName2\c:\Temp\"

0 个答案:

没有答案