• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5824
  • Last Modified:

Problem using DOS COPY command across network

I am trying to view files on
another machine using the DOS copy command  (eventually I will want
to use the DOS copy commands).  These machines are on a Local Area
Net.  The files reside on the machine known as GATEWAYLAPTOP and when
I run the NET VIEW command on machine "A" it identifies  machine "B"
as \\GATEWAYLAPTOP.  So my command is:

DIR \\GATEWAYLAPTOP\C:\

However I get an error that the file name or directory is
invalid.  Does anyone know how to do this?

0
cashonly
Asked:
cashonly
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
C: is invalid. usually, the root of the disks is mapped as c$ for example, hence:

\\GATEWAYLAPTOP\C$\

is the correct UNC path.
however, I am not sure if DIR works with UNC...
0
 
guy-pcCommented:
You can't do that, you must go to my computer, click Tools on toolbar > Map Network Drive
Select a drive letter then the path, click net > finish
goto to command, type dir <drive_letter>:
0
 
royce2020Commented:
I have a suspision that the XP cmd engine dosen't like UNC paths.
This means that you may have to map the path as a network drive.

On machine B (GATEWAYLAPTOP) run the command:
net share sea=c:\

On machine A run the command:
net use z: \\GATEWAYLAPTOP\sea /PERSISTENT:NO

now, you can list the contents of c:\ of machine B on machine A using the following commands:
Z:
dir

And Z:\ will appear in machine As file manager.
Note that this method will make the connection disapear after machine A is shut down (it gets around that annoying message saying that windows can't connect all of your network drives if machine B isn't there). You may want to write some batch files or put it in a startup script if you want it to connect each time, or you could use the /PERSISTENT:YES option for net use.
0
 
SagiEDocCommented:
Open a DOS window and type:
net use \\computername\c$ /user:username_on_remote_pc and hit enter, you will be prompted for the password of the user account that you used above for the remote PC, enter it.
After that dir \\computername\c$ will work and so will copy. Rather use robocopy, you can download it from Microsoft, it is a lot more robust for network copies.
0
 
SagiEDocCommented:
One other thing, if the path has spaces then use inverted comma's eg:
copy "\\pcname\c$\program files\test\*.*" "c:\folder"
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now