How can batch files - I copy files from subfolders

II have a directory with several folders that contain pictures, documents, etc... I need a batch file which will look through all these aand only copy files .doc to a specific folder. Now there are hundreds of these files that need to be addressed through, so I really don't want og manually, would be nice if someone could help me here

Duplicate file names... If you assume that there is not

-> These assumptions are generally bad.

is it easy to code?

-> Easy to code but hard to understand, unless you're an expert. Notice that the script fails when it encounters some "poison characters" such as brackets or double quotes. If you have one of these in your file names or folder, then a different approach is required.

off @echo
Set SourceFolder = C:\Users\JohnDoe
Define TargetFolder = D:\MyDocs
for /F "delims =" % in ('dir /s /b /ad "% SourceFolder%\*.*" ') do)
If there are some "%%a\*.doc" xcopy.exe/y "%%a\*.doc*" "% TargetFolder%\". »
)

Tags: Windows

Similar Questions

  • How can I print a copy of the files in a folder - not each file - just the list

    original title: list of print files

    How can I print a copy of the files in a folder - not each file - just the list? List of cases of printing

    How can I print a copy of the files in a folder - not each file - just the list?

    Karen's directory printer (free)

  • How can I back-up/copy outlook express files to transfer them to a new PC?

    How can I back-up/copy outlook express files to transfer them to a new PC?

    Hi lizbuff,

    You can read the following article that should help you to do so.

    How to back up and restore Outlook Express data

    You can save your Outlook Express data to removable media and then restore it on another computer.

  • How can I get a copy of the file < windows > \system32\hal.dll.

    How can I get a copy of the file \system32\hal.dll.   ?

    There are 7 possibilities for the hal.dll file and the installation of XP takes the right one to match your hardware during the installation of XP.

    That's why replace a bit difficult because you need to know which of the 7 on the XP installation CD you need.  You can guess and try things and you might get lucky, or you can try them all.  That would take some time and probably be frustrating and you would need a CD bootable XP installation genuine to start the trials and errors.

    Replace the hal.dll file becomes even more difficult, because most of the people do not have a genuine XP bootable installation CD, even if they wanted to replace the hal.dll file.  If you really want just a copy, you can understand that one you need or just copy the one you already have.

    Unfortunately, the Microsoft Answers don't ask for enough information when a new question is asked to provide you with a good idea for your problem not specified.  For all that is your problem not specified, you will need to provide additional information.

    If you see the message that your hal.dll file is missing or damaged, the chances are that the file is not really missing or damaged... Windows XP just can not find the file.

    Fix hal.dll "missing or corrupted" message is usually not too demanding and has nothing to do with the replacement of the file.

    Maybe someday the dialog box 'ask a question' forums XP will ask these questions automatically when a new thread is started so I don't have to ask every time.  It might even be possible to solve a problem in a single response when enough information is provided.

    Please provide additional information on your system:

    What is your system brand and model?

    What is your Version of XP and the Service Pack?

    Describe your current antivirus and software anti malware situation: McAfee, Symantec, Norton, Spybot, AVG, Avira!, MSE, Panda, Trend Micro, CA, Defender, ZoneAlarm, PC Tools, Comodo, etc..

    The question was preceded by a loss of power, aborted reboot or abnormal termination?  (this includes the plug pulling, buttons power, remove the battery, etc.)

    The afflicted system has a CD/DVD drive work?

    You have a true bootable XP installation CD (it is not the same as any recovery CD provided with your system)?

    What you see you don't think you need to see?

    What do not you think that you should see?

    If the system works, what do you think might have changed since the last time it did not work properly?

  • How can I restore my photos/docs from the Dell Data Safe emergency backup file?

    incompatibility with estensions file DSB

    Files saved during the backup secure files DAT Dell are the extensions of file .dsb by the Dell site. Windows 7 does not open the files to restore on reg location Windows Media as before the backup. .Dsb error message unrecognized files. How can I restore my photos/docs from the Dell Data Safe emergency backup file?

    I know that you need a Dell utility for this...

    And what has this to do with Windows 7 photos and videos, I really don't know...

  • Security How can I remove the copy and paste the files I used?

    Security How can I remove the copy and paste the files I used?

    I can't get rid of all the e-mail addresses I have copied and pasted.  No matter what I will always appear if I hit paste again.  This is a shared computer and I would rather not have my copy and paste the files stored on the computer, after that I quit.

    Thank you

    Hi Ron,

    You can copy or move information (for example, text and pictures) between files and programs using temporary storage called the Clipboard. The Clipboard is not visible, so even if you use it to copy and paste information, you never actually see the Clipboard when you do this.

    The Clipboard contains a block of information at a time. Whenever you copy information to the Clipboard, the old contents of the Clipboard is replaced by the new information.

    When you shut down the computer everything is stuck in the memory of the Clipboard is cleared.

    Please click the below mentioned link to get an overview of the clip board memory.

    http://Windows.Microsoft.com/en-in/Windows7/copy-information-between-files

    Answer please if you have any questions.

  • How can I burn a copy of the software that I purchased by download, so I have a backup on file copy?

    How can I burn a copy of the software I have a copy of the product on a DVD so I just download purchaded

    Simply drag your folder to "Burn" or create a new.

    Mylenium

  • How to transfer files from one user to another in Windows Vista?

    How to transfer files from one user to another under Vista?

    How to transfer files from one user to another under Vista?

    A simple way is to move the file to the Public folder.
    Public folder is accessible by all users.

    How...
    Right click on the file > click Move To > navigate to the Public folder > click on move.

    If you do not Move To option in your right click context Menu, here is the tutorial...
    http://www.Vistax64.com/tutorials/89196-context-menu-add-copy-folder-move-folder.html

    Use an easier method.

    PS you can also use methiod drag-and-drop rather than pass to the method. I prefer the latter.

  • How to extract files from the Windows 7 installation CD?

    I remember that on Win98, I can use SFC. EXE to extract all those files. CAB files on the installation of Win98 CD and place the files extracted into a folder I want. In addition, I don't need to know where. CAB of the target file should be some.

    The SFC. EXE in Win7 replces only system files. It does not extract and put all the files as the SFC in Win98.

    So, how to extract files from Windows 7 installation CD?

    Hello

    ·         Why you want to extract the file from the Windows 7 DVD?

    ·         What file you want to extract?

    Some of the files will be locked or currently in use by the system so that you will not be able to replace their while that started in Windows 7. Therefore, SFC scan tool is used to repair any file corruption in windows 7.

    Design by default, you can extract the files. You can copy and paste the file into your Windows 7 DVD drive, refer to the article below:

    http://Windows.Microsoft.com/en-us/Windows7/copy-and-paste-a-file

    Hope this helps,

  • How can I move my copy of photoshop from a computer dead to a new computer? I have the serial number.

    How can I move my copy of photoshop from a computer dead to a new computer? I have the serial number.

    You don't move anything from one machine to the other - it won't work.  You must install using the installation files and the serial number you have.  If you are unable to find the download for which version of Photoshop, it is through the following a link then you should identify which version you need to.  Other downloads

  • I spilled coffee on my Macbook Air and does not illuminate.  How to transfer files from the external hard drive to backup my new Macbook Air?

    I spilled coffee on my Macbook Air and does not illuminate.  How to transfer files from the external hard drive to backup my new Macbook Air?

    If you had a Time Machine backup, you can use the Migration Wizard and connect your new Mac on the external drive which has the Time Machine backup: move your content to a new Mac - Apple Support

  • Help me how to download files from icloud

    Help me how to download files from icloud

    Help me how to download files from icloud to my phone directly

  • How can I get a copy on my received emails from my account hotmail on a particular day, that I could legally use?

    e-mail not received-

    How can I get a copy on my received emails from my account hotmail on a particular day, that I could legally use

    Hello-Inbox,

    The best place to ask your question of Windows Live is inside Windows Live help forums. Experts specialize in all things, Windows Live, and would be delighted to help you with your questions. Please choose a product below to be redirected to the appropriate community:

    Windows Live Mail

    Windows Live Hotmail

    Windows Live Messenger

    Looking for a different product to Windows Live? Visit the home page Windows Live Help for the complete list of Windows Live forums to www.windowslivehelp.com.

  • How to recover files from floder.000

    How to recover files from floder.000

    Thank & the look

    Maton

    Hello

    ·         What files you are trying to recover the folder? You know the extension of the files you are trying to recover?

    To recover the files, you must know the extension of the files you are trying to recover. I suggest you change the extension that is to-say. 000 .exe or .jpg etc. depending on the program and check.

    Thanks and regards.

    Thahaseena M
    Microsoft Answers Support Engineer.

  • How to import files from my yahoo to my outlook express account. Thus, it shows on my tree of outlook express

    How to import files from my yahoo account in my outlook express 6. To only show on my outlook express 6 tree. In the yahoo Inbox

    Make sure that the account settings that you are right, in particular the port and SSL Advanced tab of the Yahoo account settings Boulder computer Maven
    Most Microsoft Valuable Professional

Maybe you are looking for