I'm able to xcopy myFolder to Xmachine but I was wondering if you guys know of a way/have a script to prompt for "what folder" to "computer name" and a side note when to use "echo" and it's purpose.
Any help would be much appreciated. Thank you
I'm able to xcopy myFolder to Xmachine but I was wondering if you guys know of a way/have a script to prompt for "what folder" to "computer name" and a side note when to use "echo" and it's purpose.
Any help would be much appreciated. Thank you
In PowerShell, create a PSSession using the New-PSSession command and you can pass it in then Copy-Item -ToPSession You can modify the following to your need (you might need to specify credentials to create the PSSession) and then wrap it into a PowerShell function:
$pssession=New-PSSession - Computername $Computername
Copy-Item -ToSession $pssession -Path $path -Destination $destination -Recurse
Remove-PSSession $pssession
I prefer to user Robocopy for robust copy-tasks.
You can combine it with powershell, a very simple example:
$whereto = Read-Host "where to"
robocopy C:\SchedTasks $whereto /MIR /w:10 /r:2 /v /tee /fp /eta
$whereto could be "c:\temp" or "\computer1\c$\temp" The other parameters are wait and retry and some verbose/display stuff for more information. You can look them op on the page i linked.
EDIT
Concerning your "echo" question. Its a function within a batch file that enables or disabled onscreen messages.