0
一個問題
我的問題是PowerShell中總是給我的錯誤信息:「着覆蓋文件與自己」,我不知道爲什麼我有拷貝項目在PowerShell中
$source=$textBox1.text
$dest=$textBox2.Text
$usr=$textBox3.text
##### ##從
$fNoBackup = "\\$source\c$\Users\$usr\AppData\Local\NoBackup\*"
$fData = "\\$source\c$\Users\$usr\AppData\Local\Lotus\Notes\Data\*"
$fCustomDestinations = "\\$source\c$\Users\$usr\AppData\Roaming\Microsoft\Windows\Recent\CustomDestinations\*"
$fAutomaticDestinations = "\\$source\c$\Users\$usr\AppData\Roaming\Microsoft\Windows\Recent\AutomaticDestinations\*"
#######要
$tNoBackup = "\\$dest\c$\Users\$usr\AppData\Local\NoBackup"
$tData = "\\$dest\c$\Users\$usr\AppData\Local\Lotus\Notes\Data"
$tCustomDestinations = "\\$dest\c$\Users\$usr\AppData\Roaming\Microsoft\Windows\Recent\CustomDestinations"
$tAutomaticDestinations = "\\$dest\c$\Users\$usr\AppData\Roaming\Microsoft\Windows\Recent\AutomaticDestinations"
#######樂複製
#############"Touch" the files ;D
New-Item -ItemType File -Path $tNoBackup -Force
New-Item -ItemType File -Path $tData -Force
New-Item -ItemType File -Path $tCustomDestinations -Force
New-Item -ItemType File -Path $tAutomaticDestinations -Force
#############Copy
Copy-Item $fNoBackup $tNoBackup -Recurse -Force
Copy-Item $fData $tData -Recurse -Force
Copy-Item $fCustomDestinations $tCustomDestinations -Recurse -Force
Copy-Item $fAutomaticDestinations $tAutomaticDestinations -Recurse -Force
我的回答對你有幫助嗎? – Binarus