Windows batch script to recursively copy file/directory of a specific patern

I would like to copy all pdf files from  directory 'src' and sub-directories 'src/src-sub1' to directory 'trgt', including the directory structure. Any suggestion? thanks!

Hi,
Run the command below:
robocopy x:\src x:\trgt *.pdf /s
How to write a batch file:
http://www.wikihow.com/Write-a-Batch-File
Andy Altmann
TechNet Community Support

Similar Messages

  • Naming output files in Windows Batch Scripts

    <p>Looking for Windows batch script syntax to autonumber,automatically name, and/or randomly name output files to avoidoverwriting output files.</p>

    I use this type of functionalithy frequently to save output logs.<BR>Here is a snippet of code that should work. It assumes that you already have the Esscmd script that performs the DBStats call and outputs the log to D:\logs\dbstats.log.<BR><BR>Let me know if you have any questions.<BR><BR>@ECHO OFF<BR>:: ==========================================================<BR>::Filename:     GetDBSTATS.bat<BR>:<img src="i/expressions/face-icon-small-happy.gif" border="0">escription:     Runs DBSTATS and rename outputfile with current date<BR>:: ==========================================================<BR>::<BR>:: Run Esscmd to get dbstats output log d:\logs\dbstats.log<BR>ESSCMD D:\script\getdbstats.ess<BR>::<BR>:: Get Current Date and Time<BR> FOR /F "TOKENS=2" %%i IN ('DATE/T') DO SET FullDate=%%i<BR> SET Month=%fulldate:~0,2%<BR> SET Day=%fulldate:~3,2%<BR> SET Year=%fulldate:~6,4%<BR><BR> FOR /F "TOKENS=1" %%i IN ('TIME/T') DO SET FullTime=%%i<BR> FOR /F "DELIMS=: TOKENS=1" %%i in ('ECHO %fulltime%') DO SET Hour=%%i<BR> FOR /F "DELIMS=: TOKENS=2" %%j in ('ECHO %fulltime%') DO SET Minute=%%j<BR><BR>::<BR>::<BR>RENAME d:\logs\dbstats.log dbstats_%month%_%day%_%year%.log<BR>EXIT<BR>

  • Windows 8.1 will not copy files from intranet site.

    I am using Windows 8.1 and I am trying to copy files from an Apple Time Capsule disk to a local hard drive. First I got the message box that said "Your Internet security settings suggest that one or more files may be harmful. Do you want to use it
    anyway?" and when I said okay nothing would copy. I went into my Internet options and added the Time Capsule disk to my site list in the Local Intranet Zone and reconnected the shared drive. Now I don't get the error box but it doesn't copy
    anything either. It does nothing. Any suggestions would be appreciated.
    Benjamin Greco Jr.

    I suggest you to run a malware check.. 
    May be its due to this malware "ZeroAccess rootkit/Sirefef"... What it does is it will block downloading and it will block you from visiting to some site... 
    Download and transfer this....
    Use one scanner at a time
    Download hitman pro 3.7  from uninfected pc and transfer to you pc and install (shareware and can be activated for 30 days free)and have a
    full system scan.. http://www.surfright.nl/en 
    alternatively you can use hitmanprokickstart usb bootable
    http://www.surfright.nl/en/kickstart
    And/or
    use malwarebyte  downloaded from uninfected pc and transfer to you pc and install and have a full system scan http://www.malwarebytes.org/products/malwarebytes_free/
    And/or
    use adwcleanerand  downloaded from uninfected pc and transfer to you pc and install and ave
    a full system scan..http://www.bleepingcomputer.com/download/adwcleaner/dl/125/)
    And/or
    use Junkware Removal  Tool  downloaded from uninfected pc and transfer to you pc and install andhave a full system scan
    http://www.bleepingcomputer.com/download/junkware-removal-tool/dl/131/
    And/or use TDSS Killer  downloaded from uninfected pc and transfer to you pc and
    install andhave a full system scan..: http://www.bleepingcomputer.com/virus-removal/remove-tdss-tdl3-alureon-rootkit-using-tdsskiller
    additional info
    If everything fails, you can use offline bootable resccue cd and do a full system scan... 
    https://support.kaspersky.com/viruses/rescuedisk
    http://windows.microsoft.com/en-us/windows/windows-defender-offline-faq
    How to create a defender offline bootable cd/pendrive
    http://www.pcandtablet.com/windows-8-antivirus-and-security/546/how-to-create-a-windows-defender-offline-usb-stick-to-remove-malware-on-windows-8-a.html
    Hetti Arachchige V Aravinda | Network & System Administrator (B.Sc, Microsoft Small Business Specialist, MCP, MCTS, MCSA, MCSE,MCITP, CCNA, CEH, MBCS)

  • Windows Explorer EXTREMELY slow at copying files from network, but robocopy works

    Hi guys,
    I'm having a REALLY BAD performance issue when copying files over from SAMBA 4 to any Windows 7 computer. To copy a folder containing 50 files with a total of 10 MB using the explorer it takes about 20 minutes (!!) at a rate of 3-5 KB/s, but when using robocopy
    the same folder takes like 3 seconds to complete. Also, the issue does not occur with older versions of Windows, like Windows XP and Windows Server 2003.
    Please please please come up with some ideas except the usuals like disabling Remote Differential Compression, disable autotuning using netsh, setting local security policies for NTML authentication or trying new switches / upgrading network drivers or windows.
    I DID IT ALL, but nothing helped!
    Thanks in advance!

    Linking in your post over on Server Fault in case it gets resolved over there first ;)
    Windows 7 extremely slow with samba 4
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • Broken: PS script to recursively zips files into one zip file

    Hi
    I'd like a script which zips all files and subfolders older than a specified date.
    I've have spent a fair bit of time hacking with no luck.
    I'd greatly appreciate any help.
    AJ
    PS. This script seems to do the trick -
     $folder = "C:\temp2\" 
     $zipFileName = "C:\temp\test3.zip" 
     $zip_date = Get-Date "6/5/2014"
     set-content $zipFileName ("PK" + [char]5 + [char]6 + ("$([char]0)" * 18)) 
     $ZipFile = (new-object -com shell.application).NameSpace($zipFileName) 
     Get-ChildItem $folder | foreach {$zipFile.CopyHere($_.fullname)} 
    However, when I enter where clause  only the top folder is zipped?
    Get-ChildItem $folder| Where-Object { $_.LastWriteTime -lt $zip_date }  | foreach {$zipFile.CopyHere($_.fullname)} 
    AJ
    Ps. I'm using script from http://stackoverflow.com/questions/5641162/compress-files-in-folder-to-zip-file-by-using-ps

    Hi Rapido2,
    Thanks for your sharing =)

  • Batch script to print PDF files to press quality

    Hello, I'm looking for a way to print PDF files to the Adobe PDF driver with "Press Quality" setting.   Ideally I could also save any file attachments first and then reattach them after printing to new files.
    I've been experimenting with the batch sequence feature but I am not getting very far.   Are there any sample scripts that do something similar to this?   I appreciate any guidance you can offer.
    Thanks
    LLL

    No, I do not have access to the original files that went into making the source PDFs.
    I've looked at PDF Optimizer but it does not shrink the file size nearly as much as printing the file through the Adobe PDF print driver with "Press Quality" setting.   I suspect this has to do with font consolidation.   PDF Optimizer seems to let you unembed fonts from the file but that's not what I'm looking for.  I need to have all fonts embedded.
    I appreciate the feedback.  Anyone else have ideas here on the original issue?  Thanks.

  • Catch procedure error in batch script

    Hi,
    I am calling the procedure inside a loop in a windows batch script.
    Is there any way i can catch the oracle exception ora- errors ? in the batch script.
    Thx.

    Batch file cannot catch errors that are thrown by oracle procedures.
    you can do some work around.
    1. push the errors to a log file (text file) from the procedure.
    2. once the procedure is complete, you can read for a specific text in the log file from Batch file. and if you find that error had occurred then do your stuff.
    Regards,
    Prazy

  • Unable to Copy File From Terminal Server to Client Share

    Hi
    For years client have been able to copy files from our Windows 2003 Terminal Server to their local workstation using:
    copy myfile \\tsclient\mydrive\myfolder
    However we upgraded to Windows 2012 Server R2 and now Windows 7 Pro clients cannot copy files.  The copy function creates the file name in their local folder but no content is sent after maybe 20 minutes or so the copy function times out and they get an
    error message saying that the application was unable to write to the file.  I have tried this function with my Windows 8.1 workstation and the file copies properly and it works fine for older Windows XP clients.  Does anyone know why Windows 7 clients
    are experiencing this issue.
    Thanks
    Simon

    Hi Simon,
    Initially please use latest RDP version 8.1 for windows 7 and check result. 
    What’s the file size which you are copying?
    Does this happens for all users and on all computers?
    You can try below method might resolve your case.
    1. Login to remote computer using Remote Desktop (RDP). 
    2. Open Task Manager in the remote machine
    3. Click the "Process" tab
    4. Locate a program called "rdpclip.exe"
    5. Right click and select "End process" to kill this program
    6. Click on "File" menu in the task manager and select "New Task (Run)"
    7. Type rdpclip.exe and press the button to start the process.
    By killing existing instance of the rdpclip.exe and restarting the program, you can get your copy paste work again in your remote desktop.
    Hope it helps!
    Thanks.
    Dharmesh Solanki
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Copy File from Terminal Server to Workstation Failure

    Hi
    For years client have been able to copy files from our Windows 2003 Terminal Server to their local workstation using:
    copy myfile \\tsclient\mydrive\myfolder
    However we upgraded to Windows 2012 Server R2 and now Windows 7 Pro clients cannot copy files.  The copy function creates the file name in their local folder but no content is sent after maybe 20 minutes or so the copy function times out and they get
    an error message saying that the application was unable to write to the file.  I have tried this function with my Windows 8.1 workstation and the file copies properly and it works fine for older Windows XP clients.  Does anyone know why Windows 7
    clients are experiencing this issue.
    Thanks
    Simon

    Hi Simon,
    The copy command should also work on the Windows 7 clients. Please provide the detailed error message when run the command on the Windows 7 clients.
    You could also use robocopy command to achieve this.
    Robocopy
    https://technet.microsoft.com/en-us/library/cc733145.aspx?f=255&MSPPError=-2147217396
    Best Regards,
    Mandy
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Adobe Bridge CC won't let me copy files to a CD

    I have formatted a CD with Windows Explorer and tried to copy files from Bridge CC to folders I have created on a CD to be printed.  When I select file and then copy to and choose the folder on the CD It says I don't have permission.  I am able to copy files from one folder to another  in my computer and folders on an external drive with Bridge CC.  I have the Windows 7 64 bit operating system.  I am able to do this using Windows Explorer.  I would appreciate any help on this.

    I do burn discs with nero and when I do that it is closed and you can't add more later.
    It seems Nero can do this trick but after the second time Bridge recognizes it as a locked read only device.
    Personally I would switch to a USB stick which is much faster and easier to use.

  • How to call a batch script from DI?

    Hi All,
    I'm new to DI/DS and would like to know is there a way to call a batch sciprt (.bat file) in DI?
    What I try to do is,
    1.call a batch script to move source files from a file server to the source folder before kicking off the data flow
    2. once the data flow is completed, call a batch script to move the processed source files to the achive folder.
    In other ETL tool like informatica it can be done via the command task, is there something similar in DI?
    Any help would be appreciated.
    Regards
    BL

    Thanks Suneer.
    Just want to clarify, when I create the script task in the work flow, should I put the path of my batch file or the batch script itself in?
    e.g., my batch script is movefile.bat under folder C:\Script,
    and the command is:  move /Y "C:\Input\*.*". "C:\Archive\".
    in the script task, should I put
    exec('cmd', 'C:\Script\movefile.bat')
    or
    exec('cmd', 'move /Y "C:\Input\*.*". "C:\Archive\".')
    Thanks again for your help
    Regards,
    BL

  • ** Is it possible to run a windows .bat script job from ODI between server?

    Hello Friends,
    We have ODI 10.1.3.5 on a Win2003 Server.
    Have a windows Batch script job .bat(this is a related to a different program - DRM) on a different Windows 2003 server...is it possible to execute .bat job thru ODI between servers?
    Appreciate your suggestions...
    Thanks.

    Hi AJ,
    Here are more details:
    Server-A: ODI Server (Win2003)
    Server-B: Oracle DRM Server (Win2003)
    Server-C: ODI scheduler agent is installed (Linux)
    We have a .bat batch script job on Server-B which we are planning to run from Server-A (as part of the ODI package execution flow)
    This .bat job exports the DRM hierarchy data to a table that ODI uses to process next steps.
    So, you are suggesting to install ODI agent on Server-B? If we do that...not sure if there be issues if we have to run the package with other scenario's (interfaces/Procedures) that refer agent isntalled in Server-C??
    Any feedbacks are appreciated!!
    Thanks

  • Windows Server 2012 R2 robocopy not copying inherited directory permission from source file server to destination ?

    Can anyone here please help me with Robocopy on Windows Server 2012 R2 to copy the file server content from \\OldFileServer\Data share into the local S:\Data drive ?
    here's my script that I use to copy 11 TB of file server contents:
    robocopy.exe "\\OLDFILESERVER\Data" S:\Data *.* /E /SECFIX /SEC /XO /ZB /COPYALL /MIR /DCOPY:DAT /R:0 /W:0 /NP /NFL /NDL /TEE /LOG:"G:\robocopy.log"
    Any kind of help and assistance would be greatly appreciated.
    Thanks
    /* Server Support Specialist */

    Hi,
    Based on my tests, inherited permissions will not be copied using robocopy.exe.
    That’s because that after we copy or move an objects to another volume, the object inherits the permissions of its new parent folder.
    My suggestion for you is to disable the inheritance on corresponding subfolders, and Convert inherited permissions into explicit permissions on this object. After that, those permissions can be copied.
    Here are some references below for you:
    Robocopy not copying NTFS permissions
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/b36748cd-14d1-47a5-9fb6-878ca93ad6fc/robocopy-not-copying-ntfs-permissions
    How permissions are handled when you copy and move files and folders
    http://support.microsoft.com/kb/310316
    Powershell ACL commands? NTFS Permissions - Turn inherited permissions into explicit permissions and remove inheritance
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/884e2837-ec1d-4937-83a5-722cd00d7d16/powershell-acl-commands-ntfs-permissions-turn-inherited-permissions-into-explicit-permissions-and?forum=ITCG
    Best Regards,
    Amy

  • File copying in Batch script and renaming

    HI,
    I am using the below batch script to copy the files from current folder to the specified location.
    (@echo off
    echo copying files to destination
    copy *.eps* \\10.10.14.13\adman\in\displ )
    I am facing 2 problems in the above script..
    1. I am not able to select a particular file and run the script, for e.g if the folder got more (eps) files it copies all the files to the location.
    2. I want to insert my user login name at the end of the each copied file.
    My file name look like (F0#CGDBANG000947532#.eps
    ) copy to F0#CGDBANG000947532#username.eps
    Thanks for all the help

    Hi,
    About this issue, I recommend you consult Script Center forum for professional help:
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?category=scripting
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or
    learn from your interaction with us. Thank you for your understanding.
    Karen Hu
    TechNet Community Support

  • Logon Scripts for copying files in Windows 7

    Issues using Logon scripts to copy files in windows 7.  Its default is to append the file rather than copy and replace, which is what XP did.  How can I achieve the same results using
    logon scripts in W7 to copy any files to specified folders and replacing old files.  The reason for this is that we use a software that performs offsite/onsite updates and the only way all the users can have the correct version/tables is to either manually
    update each user in a 90+ user environment or use a logon script to perform the coping of the updates.  Unfortunately the software support won’t create a (while logging in to software) patch for this.  So we have to force it during the user logon.

    Hi Novice,
    It should depend on your script content. it's recommended you ask in the official scripting guys forum for professional help:
    https://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG
    Karen Hu
    TechNet Community Support

Maybe you are looking for

  • Windows Vista trouble finding airport base station

    I recently bought an AirPort Extreme 802.11n. It was easily able to connect it to my mac, but when I try to connect it to my Windows Vista desktop computer, the base station in the airport utility software cannot be found. It finds the internet from

  • HT1688 How do I delete all my pictures from my new phone?  IPhone 5S

    Help, have a ton of pics on my iphone 5s and I can't delete them and they are taking up all my space.

  • Passing large input from ADF taskflow to servlet

    Hi, Using JDeveloper 11.1.1.4. We have an application where we need to render dynamic content on the page so we are using a popup window with an inline frame component which calls a servlet that provides the content. This is working fine otherwise bu

  • How to stop the duplicate idoc processing ? whar need to done SAP R/3

    Hi All If the Same Idoc is processed to SAP R/3 then what to do for not processing the duplicate IDOC ? Or some thing like this... If by mistake same idoc processed then how to avoid to process the idoc? what i need to in SAP R/3 side? Regards Kiran

  • IWork updaters refuse to recognise apps

    I downloaded the Pages 3.0.1 Update, the Keynote 4.0.2 update and the Numbers 1.0.2 update but, for each of them, when the installer program runs I get this message... "An eligible Pages application was not found in the location /Applications." I rea