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

Using command prompt to sent/receive file

Using the command prompt..
how can i sent a file/folder or vice versa??
I am under a LAN..although I know tat i can share files with my local friends but I want to learn the command prompt way....

izzit something like:  net file?
or whatever..

thanks.....need you experts help
0
joely2k
Asked:
joely2k
  • 3
1 Solution
 
lrmooreCommented:
First, map a drive:
C:\>net use M: \\server\share
Command completed successfully

Then just use copy command
C:\>copy file.doc M:
C:\>copy C:\data\file.xls M:\data
C:\>copy M:\data\file.bat C:\data

C:\>copy /?
Copies one or more files to another location.

COPY [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B]
     [+ source [/A | /B] [+ ...]] [destination [/A | /B]]

  source       Specifies the file or files to be copied.
  /A           Indicates an ASCII text file.
  /B           Indicates a binary file.
  destination  Specifies the directory and/or filename for the new file(s).
  /V           Verifies that new files are written correctly.
  /N           Uses short filename, if available, when copying a file with a
               non-8dot3 name.
  /Y           Suppresses prompting to confirm you want to overwrite an
               existing destination file.
  /-Y          Causes prompting to confirm you want to overwrite an
               existing destination file.
  /Z           Copies networked files in restartable mode.

The switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line.  Default is
to prompt on overwrites unless COPY command is being executed from
within a batch script.

To append files, specify a single file for destination, but multiple files
for source (using wildcards or file1+file2+file3 format).

C:\>

0
 
lrmooreCommented:
You can also just use UNC instead of mapping a drive:

C:\>copy c:\data\file.doc \\server\share\data
C:\>copy \\server\share\data C:\data

0
 
joely2kAuthor Commented:
what is the meaning by mapping the drive?

0
 
lrmooreCommented:
If I "map" a drive, I am creating a new drive letter that my PC will uses as if it was a real local drive. Then, I can copy files back/forth, run executables, etc just by changing location to that drive letter:

C:\>net use M: \\server\share
The command completed successfully

C:\>M:
M:\>dir (same commands that are available to me from the C:\> local drive prompt.



0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

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