Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

I used powershell remoting to copy a file from shared drive from one system to other system, but nothing copied and also no Error in script

$
0
0

I used powershell remoting to copy a file from shared drive from one system to other system, but nothing copied. Hers is the code.

I tried to copy a file from view-xxx9 to view-xxx007. System view-xxx9  has sharefolder servicemsi and share name is msishare1. I tried\\view-xxx9\servicemsi also.

Invoke-Command -computername view-xxx007 -scriptblcok{

copy-item "\\view-xxx9\msishare1" "c:\servicemsi" -recurse

}

And also i used WMI

$file = "c:\copy.bat"

Invoke-WmiMethod Win32_process -Name Create -ArgumentList $file -ComputerName view-xxx007

Copy.bat

@echo off

robocopy "\\view-xxx9\msishare1" "c:\servicemsi"

I haved careated batch file remote system and also I got received return code 0, but nothing copied.


Dhanraj



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>