0

I am using below code :

Copy-Item "\\10.X.X.Z\E:\abc\TASKS\AUTO_DAILY_TOLL_NOTICE" -Destination "\\10.X.X.Y\E\AshimTest\myscript" -Recurse

shows up error:

Copy-Item : Cannot find path 
'\\10.X.X.Z\E:\CAS\TASKS\AUTO_DAILY_TOLL_NOTICE' because it does not 
exist.
At line:1 char:1
+ Copy-Item "\\10.X.X.Y\E:\CAS\TASKS\AUTO_DAILY_TOLL_NOTICE" -Destination 
"\\10 ...
+ 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: 
(\\10.0.0.Z\E...ILY_TOLL_NOTICE:String) [Copy-Item], 
ItemNotFoundException
+ FullyQualifiedErrorId : 
PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand

I am missing something here.

Both the servers have credentials, is it because of that ??

I am actually copying from 10.X.X.Z server to 10.X.X.Y server where the powershell script is running.

ashim
  • 67
  • 1
  • 2
  • 12
  • this may help https://stackoverflow.com/questions/14653851/need-help-on-powershell-copy-item-from-network-drives – Owain Esau Apr 05 '18 at 02:16
  • Also those paths don't look correct. If you put those into windows explorer are you able to access the folder? – Owain Esau Apr 05 '18 at 02:17

1 Answers1

0

With network drives you usually use e$ rather than e:

If you try the following, what is the result?

Copy-Item "\\10.0.0.49\E$\abc\TASKS\AUTO_DAILY_TOLL_NOTICE" -Destination "\\10.10.0.50\E$\AshimTest\myscript" -Recurse
Jacob
  • 1,182
  • 12
  • 18