How do I copy a file from server to client using commandline

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
john999
Junior Member
Junior Member
Posts: 4
Joined: 2013-02-23, 03:13 UTC

How do I copy a file from server to client using commandline

Post by *john999 »

Hi,

This seems like a question with obvious answer but after browsing through tens of past posts, people stop at suggesting "you can use xcopy" or "xxcopy" or other tools to copy in commandline.

My question is, how do I actually refer to the destination path?

For example my laptop (client) running Windows 7 is connected via USB transfer cable to my desktop computer (server) which can be either Windows 7 or XP.

Suppose I want to copy
desktop computer's c:\test.txt
to
laptop's c:\comehere directory

I have Total Commander on both computers running for client and server and all smooth and running.

On the server computer I go into commandline prompt and type :
Copy c:\test.txt PATH2
What do I put in the place of PATH2?

Or alternatively on the client computer I go into commandline and type:
Copy PATH2\test.txt c:\comehere
What do I put in the place of PATH2?

Thanks a lot. As I said this sounds like a question with obvious answer but I just can't find it. Would appreciate any help. (Note I am not interested in using the GUI which although excellent is not what I am asking about right now).
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

You need to share some folder of your laptop, or you can try to access \\<laptop's ip>\C$ in TC or Explorer (Windows will ask you for username/password, this won't work with account w/o password), then you can assign a drive letter for \\<laptop's ip>\C$\comehere using TC's 'Net\Network connections' menu item or just copy files using this path (you can specify such path as command argument but you can't use cd command with such path since command line doesn't support UNC paths).
john999
Junior Member
Junior Member
Posts: 4
Joined: 2013-02-23, 03:13 UTC

Post by *john999 »

MVV wrote:You need to share some folder of your laptop, or you can try to access \\<laptop's ip>\C$ in TC or Explorer (Windows will ask you for username/password, this won't work with account w/o password), then you can assign a drive letter for \\<laptop's ip>\C$\comehere using TC's 'Net\Network connections' menu item or just copy files using this path (you can specify such path as command argument but you can't use cd command with such path since command line doesn't support UNC paths).
MVV thanks.

I right clicked on laptop's comehere directory and shared it.

Then I run Total Commander on laptop as server.
Run Total Commander on desktop computer as client.

My laptop is called JOHN-PC.
My desktop computer is called SILVERSTONE-PC.
To get their ip address I just typed ipconfig and look at ipv4 value:

For the laptop I get this:
Autoconfiguration IPv4 Address: 169.254.6.124
Subnet Mask: 255.255.0.0
Strangely for the desktop computer, I get this:
Tunnel adapter isatap.{F45867A6-something something something}:
Media state...... : Media disconnected
Connection-specific DNS Suffix .: (nothing, just blank).

Tunnel adapter Teredo Tunneling Pseudo-Interface:
Media state......: Media disconnected
Connection-specific DNS Suffix .: (again nothing, just blank).
Anyway so I just referred to the computers by their names.

In command prompt I typed:

copy *.* \\JOHN-PC\C$\comehere

This should copy everything in current directory of desktop computer, to laptop's C:\comehere.

But I get this message:

The network path was not found.
0 file(s) copied.



What should I do please? When I try using the GUI to copy, it's not a problem at all. So I think we don't even need to set up any extra network in order to copy. Otherwise how is the GUI doing it?

Also, it seems to me the GUI is using FTP protocol over the USB link. So maybe I should use FTP commands to copy the files? I don't mind doing it that way but how do I actually issue the command please? All I want is to under commandline, get test.txt from server's whatever directory, copied to client's \comehere directory.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

AFAIK you should be able to access UNC path from command line if you're able to access it via TC or Explorer. If you want to do all operations from command line, try command net use /? - it allows to assign a drive letter for network path.

And, you can't use command line to control TC connections.
Phred
Senior Member
Senior Member
Posts: 382
Joined: 2009-06-16, 15:24 UTC
Location: SEAu

Alternative Copying

Post by *Phred »

How did you go with that, John999?

The last line of MVV's post seems the most pertinent - TC is irrelevant/inappropriate to your needs.
You can use a simple DOS box to copy between places, so why not do that?
The GUI works, so, even more so, why not use that?
Indeed, TeraCopy, configured into TC, streamlines the copying and moving process, within a GUI, so why not use that?
(Setting up TeraCopy is a bit of a nuisance because its author doesn't recognise Standard User accounts, so you have to manipulate lines within your admin account's ini file and that in your user account. :? )
Phred
Senior Member
Senior Member
Posts: 382
Joined: 2009-06-16, 15:24 UTC
Location: SEAu

BTW

Post by *Phred »

BTW:
MVV wrote: [... snip ...] - it allows you to assign a drive letter for network path.
-snip-
Post Reply