How can I copy a file from my machine to another machine from command line?

Solution 1:

Assuming you have appropriate permissions, you can do it like this:

copy local_file.txt \\target_machine\c$\dest_file.txt

Use "c$" to reference C drive on the remote machine.

Solution 2:

It's like this:

copy c:\local_path\local_file.txt \\target_machine\destination_path\destination_file.txt

If you have \\target_machine\destination_path\ mapped to a network drive, say, Z: then the command becomes

copy c:\local_path\local_file.txt Z:\destination_file.txt