Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi.

I am Trying To Copy A file using The cmd Line.

When I copy It on The local disk The Following command Works:

C:\>copy \1\a.txt \1\b.txt

If I try The Same Line on a mapped Network drive It Fails

If I try The Same Command but without The inner folders

It works :
T:\>COPY A.TXT B.TXT

How Can I Copy With directions to Inner Folders On A Network Drine ?

Thanks

Dj4400
Posted
Updated 22-May-13 0:02am
v2
Comments
[no name] 22-May-13 6:04am    
What does this have to do with C? Or C++? What does "It Fails" mean? The error message that is displayed to you when "It Fails" would tell you what is wrong.
Richard MacCutchan 22-May-13 9:42am    
Does the folder 1 actually exist in the root of the T drive?
Jiří Miklík 23-May-13 9:08am    
It seems you have no rights to write in inner folder on mapped disk T:
dj4400 27-May-13 3:45am    
The coonection to c ++ is that i want to make this copy command in my app.
So I Tried it First on The cmd Line

As noted in comments, this doesn't look like a C/C++ problem.

My guess is that the network drive has insufficient access for you to write to it. The problem is either directory (or file) ownership or file protection on the network drive.
 
Share this answer
 
It appears that the required syntax
Is With "."
The command:
T:\>copy .\1\a.txt .\1\b.txt

Works.
However i Am
Not Sure I Understand Why...
 
Share this answer
 
Comments
Richard MacCutchan 27-May-13 4:14am    
Obviously because there is no directory named 1 in the root of the drives, but there is one below your current working directory. I suggest you read the technical documentation on path names and their structure.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900