how to copy several files to somewhere?
Moderator: DosItHelp
-
- Posts: 84
- Joined: 08 Sep 2010 10:25
- Location: Iran,Kashan
- Contact:
how to copy several files to somewhere?
i want to copy two files for example c:\a.jpg and c:\a.txt to d:\
how to do it by 1 line command?
(not using "for" command)
how to do it by 1 line command?
(not using "for" command)
Re: how to copy several files to somewhere?
Mohammad_Dos wrote:i want to copy two files for example c:\a.jpg and c:\a.txt to d:\
how to do it by 1 line command?
(not using "for" command)
In this example, this should work.
Code: Select all
copy /b C:\a.* D:\
-
- Posts: 84
- Joined: 08 Sep 2010 10:25
- Location: Iran,Kashan
- Contact:
Re: how to copy several files to somewhere?
i just want to copy these certain files. not any more. some other files with the same name "a" my be exist
Re: how to copy several files to somewhere?
Mohammad_Dos wrote:i want to copy two files for example c:\a.jpg and c:\a.txt to d:\
how to do it by 1 line command?
(not using "for" command)
My question is why do you want that?
Re: how to copy several files to somewhere?
Only way I can see to do it is with a FOR command.
for /F "tokens=*" %G in ('dir /a-d /b C:\a.txt C:\a.jpg') do copy %G D:\
for /F "tokens=*" %G in ('dir /a-d /b C:\a.txt C:\a.jpg') do copy %G D:\
Re: how to copy several files to somewhere?
He doesn't want to use the for command, Squashman.
The solution is very simple - and it seems to me like it is a question from an academic course.
The solution is very simple - and it seems to me like it is a question from an academic course.
Re: how to copy several files to somewhere?
I suppose you could do this as well.
copy a.txt T:\ & copy a.jpg T:\
copy a.txt T:\ & copy a.jpg T:\
Re: how to copy several files to somewhere?
Yeah. Maybe you should let him think for himself for such an elementary answer.
Re: how to copy several files to somewhere?
foxidrive wrote:and it seems to me like it is a question from an academic course.
I thought that as well.
-
- Posts: 84
- Joined: 08 Sep 2010 10:25
- Location: Iran,Kashan
- Contact:
Re: how to copy several files to somewhere?
thanks to all