PoSH: Robocopy Error 161 (Network Share to Remote PC)

0

I'm trying to put together a PowerShell function that will copy over (2) DLL files from a network share that everyone can access to the specified remote computer, then register those (2) DLL's. Everything works except for the Robocopy feature. When I try to Robocopy the folder from the network share to the C: root of a remote computer. When I run the function I receive this error:

2019/08/08 10:22:05 ERROR 161 (0x000000A1) Accessing Destination Directory 
\\\C\PDFXEdit\
The specified path is invalid.

2019/08/08 10:22:05 ERROR 161 (0x000000A1) Creating Destination Directory 
\\\C\PDFXEdit\
The specified path is invalid.

2019/08/08 10:22:05 ERROR 161 (0x000000A1) Creating Destination Directory 
\\\C\PDFXEdit\
The specified path is invalid.

This is my Powershell function:

function bookmark
{   
$PCName =  Read-Host -Prompt 'Enter Remote PC Name'
Enter-PSSession -ComputerName $ComputerName;
Robocopy "\\SERVER1\data2\Universal Software\AppFolderToCopy\" 
"\\$ComputerName\C$" /mir /w:0 /r:0
Invoke-Command -ComputerName $PCName -ScriptBlock {cd "C:\PDFXEdit"; 
regsvr32 C:\PDFXedit\PDFXEditCore.x86.dll /s; regsvr32 
C:\PDFXedit\PDFXEditCore.x64.dll /s}
}
powershell
robocopy

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0