Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

how to copy select files with one command


  • Please log in to reply

#1
justsaying2008

justsaying2008

    New Member

  • Member
  • Pip
  • 3 posts
I want to copy 3 files, file1.txt file7.txt and file9.txt located in the c:\files directory to my c:\newfiles directory without typing 3 copy commands and without combining the files together as one. I have read the /? for copy and xcopy with no help as well as many internet searches without an answer for this particular problem.

c:\files> copy file1.txt+file7.txt+file9.txt c:\newfiles creates one file composed of the 3 files. I do not want this. I want 3 seperate files.

I do not want a batch file "for %I in (file1.txt file7.txt file9.txt) do copy %I c:\newfiles"
If I can do it via windows explorer with my mouse and my ctrl key, there should be a way to use the copy or xcopy command to accomplish this. Please help.
  • 0

Advertisements


#2
SleepyDude

SleepyDude

    Trusted Helper

  • Malware Removal
  • 4,980 posts

...
If I can do it via windows explorer with my mouse and my ctrl key, there should be a way to use the copy or xcopy command to accomplish this. Please help.


No you can't using only windows normal commands. I only know the solutions you mention batch and for.
If you want more functions on the command line check Take Command the TCC/LE its free for home use.

On tcc you can use copy file1.txt file7.txt file9.txt c:\newfiles without any problem.
  • 0

#3
justsaying2008

justsaying2008

    New Member

  • Topic Starter
  • Member
  • Pip
  • 3 posts
Thanks Sleepy Dude, funny how the simple things seem to be the most irritating to figure out.
  • 0

#4
RoniS

RoniS

    Member

  • Member
  • PipPip
  • 10 posts
Hope it's the right place to ask - but how do you do it with a "for" (I guess you mean a "for" loop right? :unsure: ) and a batch file?
(as in - what are the commends, and in what programing language is it done?)

I'm pretty new at all programing stuff so it might seem a simple question...
I can also use a link to some guide

Thanks!
  • 0

#5
SleepyDude

SleepyDude

    Trusted Helper

  • Malware Removal
  • 4,980 posts
Hi RoniS,

This isn't exactly programing its Batch a Scripting language available on Windows that is interpreted by the Windows Command Interpreter (cmd.exe), it can be used to automate certain tasks.
You can learn about Batch files and several techniques on this site http://www.robvander.../batchfiles.php for example.

Like justsaying2008 posted above you can use the for command inside a batch file (create a text file and name it to something.cmd)
for %I in (file1.txt file7.txt file9.txt) do copy %I c:\destination_folder\

Edited by SleepyDude, 08 November 2012 - 01:54 PM.

  • 1

#6
RoniS

RoniS

    Member

  • Member
  • PipPip
  • 10 posts
Cool, Thanks a lot Dude! :notworthy:

(I didn't know Batch files had other uses other than copy and paste :rolleyes: )
  • 0






Similar Topics

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP