title: Copy a file from a network share to a remote PC`s harddisk
body: <p>I have this test setup:</p>
  
  <pre><code># Attach a network drive to X
  net use X: \\MySharename\Exchange /user:MyUser MyPassword
  
  # copy test.txt file from share to a remote computer D (Dev)
  copy X:\test.txt MyComputerNameOrIP\D:\
  </code></pre>
  
  <p>How do I syntactically correctly write the target system "MyComputerNameOrIP\D:\"</p>
  
  <p>I want to copy/paste the test.txt file from Share X to another computer`s harddisk D:\</p>
  
  <p><strong>UPDATE</strong></p>
  
  <pre><code>net use X: /delete
  
  # Attach a network drive to X:
  net use X: \\MyShare\Exchange /user:myuser mypass
  
  # copy test.txt file from share to a remote computer D (Dev)
  Copy-Item -Path X:\test.txt '\\MyComputername\D$'
  </code></pre>
  
  <p>Then I get the error: "Copy-Item : The network path was not found."</p>
  
  <pre><code>][Step 5/5] X: was deleted successfully.
  
  [12:59:36][Step 5/5] 
  
  [12:59:36][Step 5/5] The command completed successfully.
  
  [12:59:36][Step 5/5] 
  
  [13:00:19][Step 5/5] Copy-Item : The network path was not found.
  
  [13:00:19][Step 5/5] At C:\TeamCity\buildAgent\temp\buildTmp\powershell1776282632632814927.ps1:7 
  
  [13:00:19][Step 5/5] char:1
  
  [13:00:19][Step 5/5] + Copy-Item -Path X:\test.txt '\\MyComputername\D$'
  
  [13:00:19][Step 5/5] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
  [13:00:19][Step 5/5]     + CategoryInfo          : NotSpecified: (:) [Copy-Item], IOException
  
  [13:00:19][Step 5/5]     + FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Comma 
  
  [13:00:19][Step 5/5]    nds.CopyItemCommand
  
  [13:00:19][Step 5/5] 
  </code></pre>
  
  <p>The computer name is of course faked for SO...</p>