Copy the files along with folders

Hi Forum!

I have this little script to copy files which is located in the folder.

My request of forum, is to get help, to copy all the content in the folder...

contained in the record, may be *.indd, * .zip, *. TIF, *.eps, etc., and also the files in the folders and its contents..

Currently, I can only able to copy only the files (*. *) in the folder and can not able to copy the file in the folder and its files...

var copyFolder1 = file ('/ users/admin/Desktop/LZW/For General');

var pasteFolder1 = Folder('/Volumes/CTC/Normal/MyFiles');

var myFiles2 = copyFolder1.getFiles ("*.") *") ;

for (i = myFiles2.length - 1; i > = 0; i--) {}

Ditto var = myFiles2 [i] corresponding (pasteFolder1 + "/" + myFiles2 [i] .name);

}

Please can I get help to do this.

Thanks & rgs.

Just change the first line to choose the correct folders.

copyFolder(new Folder("C:/Source Folder"), new Folder("C:/Destination Folder"));

function copyFolder(sourceFolder, destinationFolder) {
    var sourceChildrenArr = sourceFolder.getFiles();
    for (var i = 0; i < sourceChildrenArr.length; i++) {
        var sourceChild = sourceChildrenArr[i];
        var destinationChildStr = destinationFolder.fsName + "/" + sourceChild.name;
        if (sourceChild instanceof File) {
            copyFile(sourceChild, new File(destinationChildStr));
        }
        else {
            copyFolder(sourceChild, new Folder(destinationChildStr));
        }
    }
}

function copyFile(sourceFile, destinationFile) {
    createFolder(destinationFile.parent);
    sourceFile.copy(destinationFile);
}

function createFolder(folder) {
    if (folder.parent !== null && !folder.parent.exists) {
        createFolder(folder.parent);
    }
    folder.create();
}

Tags: InDesign

Similar Questions

  • I just copy a file by ctrl + c then I'll stick with ctrl + v, that after I copy the file (b) by ctrl + c and paste ctrl + v and once again if I need to paste everything first: to leave what shortcut I use

    I just copy a file by ctrl + c then I'll stick with ctrl + v, that after I copy the file (b) by ctrl + c and paste ctrl + v and still, if I need to paste everything first: to leave what short cut I have we

    On Mon, 24 Sep 2012 15:49:08 + 0000, ajay8055 wrote:

    I just copy a file by ctrl + c then I'll stick with ctrl + v, that after I copy the file (b) by ctrl + c and paste ctrl + v and still, if I need to paste everything first: to leave what short cut I have we

    You can't do it without third-party software. Just go back and
    Copy the file (a).
    Ken Blake, Microsoft MVP

  • Transfer the file RAW with edited Information?

    I have Lightroom on my pc laptop and desktop (Windows Vista and Windows 7 64 bit respectively).  I copied a few Canon RAW CR2 files to my laptop in the field and edited some of the files.  Is it possible to transfer these changes, along with the files on my desktop pc?

    Probably do you a temporary LR catalog on the LT to make your changes, but your permanent catalog is on the DT?

    On your LT, if you use the library / metadata / save metadata to the files (plural) with selected images in the library grid, you should get an XMP file for each file CR2 containing the snapshot of adjustments when you perform the backup.  Copy the CR2 as well as the XMP file on your desktop, and when you import the changes will be part of the State of the initial import.  If you have already imported the files on your w/o the XMPs DT, then remove them from the library of DT (but not record) and reimport them after copying the XMP files above.

    If it is something unique, then the single transfer and CR2/XMP is ok.

    Depending on what else is in the your LT LR catalog, you can export a catalog, with just your images and their settings and import this catalog on your DT, change the paths to the images if necessary on the side of DT.

    Presumably, you know how to copy files (CR2s, XMPs, LRCATs) from your laptop to your desktop through a network or a USB drive connected, right?

    Either of these processes is a little messy.  If you do this on an ongoing basis then think about how to make the process as simple as possible.  What I do is have the LR catalog and images (for the last year, at least) on an external drive 1 TB USB3-speed that I bought at Best Buy, where drive letter is set to be the same on both computers I use LR on, and then I just plug in the USB drive to any computer I want to use at the moment.  I backup all the contents of the drive every night at a different speed USB3 drive so if I never forget that I'm wearing autour and destroy it, then I have another copy of everything.

    The initial copy took time, but changes in nightly replication does not take too long.  I use PTReplicator from KarenWare to plan a my pictures folder replication nightly at 02:00.  There are other similar programs to facilitate unidirectional replication such as RoboCopy SyncToy and DoubleTake.

  • ENVY of HP dv7: copy the file fails error on disk 2 to 58% HP recovery

    My hard drive in my dv7 ENVY dies for the second time in two years (it was under warranty last time and I was able to fix). I bought the hard drive same exact (Samsung, 1 TB), tested in BIOS, past everything. When I try to make the image recovery with the HP recovery discs I received the last time my hard drive died, I get an error then that 58% on two recovery disc that says:

    Reducer

    Copy the file fails

    From: d:\preload\base24. STORMWATER MANAGEMENT

    To: c:\RM\Image\BASE24. STORMWATER MANAGEMENT

    Press OK to retry.

    I press OK and it does the same thing over and over again. People who questioned him on this same type of error seem to get anywhere here, but what choice do I have? The hard drive is the same size, same manufacturer, same model, it should have the question of reimage the system on a hard drive more small, right?

    Am I just out of luck on that? So frustrated.

    englejas

    Hello;

    Let me welcome you on the HP forums!

    I read your post on recovery issues and wanted to help.

    Here is the link to the tool of creation of win8.1 media: installation media to create for Windows - 8.1 help Windows

    Understand, however, you might encounter a problem installing using the media created from this tool.

    You have a version of OEM HP of Win8 installed on your PC, and this means that the product key that is embedded in the motherboard UEFI firmware is OEM, not retail.

    While the media created from this tool SHOULD be activated using this key, there is no guarantee he will do.  If it is not the case, you can use this tool to recover your product key and try to enter it manually: Download Windows OEM Product Key Tool - MajorGeeks

    IF it still does not work, then your only recourse would be to order a new set of recovery from HP discs.

    You can look online for recovery from the paged media related: http://support.hp.com/us-en/drivers

    Once there, enter your product name or number. On your software page and download the drivers, select your operating system and version. Click on "Update".  If the HP recovery support is available for your computer, down near the bottom of the page, you will see an entry for the command Recovery Media-CD/DVD/USB. Click on the symbol '+' to expand this entty and click on order to press for more details.

    Or, if you prefer, you can do the same by contacting HP Customer Service:

    If you live in the United States or the Canada, details are on this page: http://www8.hp.com/us/en/contact-hp/phone-assist.html#section1

    If you live elsewhere, contact details are on this page: http://www8.hp.com/us/en/contact-hp/ww-contact-us.html

    NOTE: once you get through, stay on the line until you are finally able to talk to someone ' one - it can take a while!

    However, HP customer care is generally not available on weekends, so you will have to wait until Monday to contact them.

    Good luck

    ========================================================================
    I'm a volunteer and I do not work for, or represent, HP.
    ---------------------------------------------------------------
    If my post helped you, please click on the symbol of the thumbs-up to the left of the answer key to say thank you.
    If my message solved your problem please click on "Accept as Solution" - to help others to find the solution.
    ========================================================================

  • Copy the file fails the Windows 7 recovery discs sent hp

    I have tried to solve this problem for a month now and I'm at the end of my home.
    I am now on my third set of recovery discs HP and all have the same problem. I insert disk 1 by following the instructions on the support forum. She's going through
    Reformat the hard drive windows partition - tick
    Copy of the files needed to restore the hard drive - tick
    And immediately as ending, this window appears:
    Reducer
    Copy the file fails
    From: E:\PRELOAD\BASE. STORMWATER MANAGEMENT
    To: C:\RM\Image\BASE. STORMWATER MANAGEMENT
    Press OK to retry

    Three series of drives have the same come.
    What the hell is happening?
    I'm so sick of this.

    Read a few other posts with similar problems, but can't seem to find the solution. I don't have an external hard drive, I can use... only the laptop I'm trying to fix. (G6-1305sa)

    Any help? It also doesn't help when the HP support is open on the phones until 5:30 from Monday to Friday. I'm at work so can't call. So frustrating...

    Aaaarrrrrgggghhhhh

    Hi Belj,

    Thank you for visiting the Forums HP's Support and welcome. I read your thread on your HP Pavilion g6-1305sa Notebook and not able to restore Windows. If the HARD drive is faulty, this can cause the restoration should not go well. You can try to run a test of material. Please note remove any and all USB devices and remove the memory card in the slot of the card reader. Disconnect all non-essential devices. What is the original HARD drive? Have you replaced all other parts? Have you tried to do a clean install of Windows 7. Try running sfc/scannow would scan your system to find errors on the command line. You can get to the command prompt by clicking F11 at startup. You can see this Microsoft document on the system recovery options.

    Hope this will help.

    Thank you.

  • I can restore the backup made by WHS v1. PP3 the WHS 2011? Or do I need to copy the files over the network of old serevr again?

    WHS backup

    You just bought a new WHS 2011. Question, can I restore the backup made by WHS v1. PP3 the WHS 2011?  Or do I need to copy the files over the network of old serevr again?

    Hello

    Because the problem is with Windows Home Server, I recommend you post this question in the Forums Windows Home Server.

  • Setup cannot copy the file hpinkins5412.exe

    Setup cannot copy the file hpinkins5412.exe

    Using full features software and pilot OJ6500_E710n - z_334.4

    When I use this version:

    full feature software and driver OJ6500_E710n-z_1315

    All software installs normally.  I get all the correct screens.  I connect to a network printer. He fined the printer. He asks me where (postcode), I use the software.  I re - start.  The drivers are not installed.  I have run the diagnostics.  He said that the drivers are not installed.

    HP Officejet 6500 has more 710n

    XP Pro sp3

    I solved the problem with the latest version of the software:

    full feature software and driver OJ6500_E710n-z_1315

    The pilot would not have installed.  I used this web page to fix:

    http://support.HP.com/us-en/document/c01084522

    Thank you

    Docfxit

  • I get an error "Setup cannot copy the file els.dll" during the installation of Service Pack 3.

    The installation fails every time with this error. I can see and select the file in the temp folder, but it won't work. Any help would be appreciated. '

    Original title: 'Setup cannot copy the file els.dll' during the upgrade to Windows XP SP2 to SP3.

    In fact, I corrected it an hour ago and was meaning that close the message. I cleaned with CCleaner temporary files, downloaded the SP3 Installer on its own (no windows update) and disabled the antivirus. I was able to complete the installation.

    Thanks for the reply!

  • I am trying to format my PC and when the installer loads of my key USB Kingston, he said: Setup cannot copy the file XPtspCom.inf.

    Setup cannot copy the file XPtsp Com.inf

    Hi all!
    I try to format my PC and what configuration is loading my Kingston USB key, said he: Setup cannot copy the file XPtspCom.inf.

    I use Windows XP Professional Edition SP3.
    How do slove this problem please to continue to work with my PC?
    Thanks in advance!

    You should not use these programs, but if you want a USB key to install then you should make an ISO file and then using Unebootin according to me this is a best software to USB for xp and if you have windows 7 installed in one of your system, then you can use tool usb windows 7.

  • Cannot install the update of security KB2698365, get the error message ' set up cannot copy the file msado15.dll.

    Tried several times, if I check the update log it shows canceled, have tried to disable Norton. Tried to install it manually through the Setup Wizard.  He gets up then I get the message "set up cannot copy the file msado15.dll.

    Hello

    You did changes to the computer before the show?

    Method 1
    I suggest you to run the fixit from the following link:

    The problem with Microsoft Windows Update is not working
    http://support.Microsoft.com/mats/windows_update/

    Method 2
    I suggest you register the Msado15.dll file required.

    a. Click Start and then click Run.
    b. in the run dialog box, type the following commands in the Open box and then click OK.

    Regsvr32.exe ">"

    The> placeholder is the absolute path of the file Msado15.dll.

    The following examples show how you can specify an absolute path:

    Regsvr32.exe "C:\Program Files\Fichiers Files\system\ado\Msado15.dll"

    If the Msado15.dll file is saved successfully, you receive a message similar to the following message:

    DllRegisterServer in C:\Program Files\Common Files\system\ado\Msado15.dll successful.
    c. click OK.

    Method 3
    I suggest to perform the clean boot and then try to install the updates. Clean boot will disable all of the third-party program to ensure that all third party program is not causing the problem.

    How to configure Windows XP to start in a "clean boot" State
    http://support.Microsoft.com/kb/310353

    Note: Make sure that you reset the computer back to normal once the diagnosis is complete.

    Method 4
    I would say that you can download and install the update to the clean boot from Microsoft download center.

    Update security for Windows XP (KB2698365)
    http://www.Microsoft.com/en-US/Download/details.aspx?ID=30228

  • Copy the files from the flash drive on the hard drive but I don't want to copy the files I already have.

    I have Windows XP.  I have a flash drive with many files that I have on my second hard drive.  I just it copies the files that I have on the hard drive and I don't want to have to sit and answer 'yes' or 'no' question about the replacement of files each time that it recognizes a file duplicate. How do I do that?

    When you see this double prompt or not, are there not a checkbox that says something like "Always do this for all files" or something in that sense?
     
    You can manually copy the files. Here is the CTRL key while you click the files you want and then just drag them to the location on the HARD drive.
  • Windows xp sp2 Setup error: Setup cannot copy the file: usrshuta.exe.

    I want to install windows xp sp2 on the new hard drive and got the following error: Setup cannot copy the file: usrshuta.exe. How to do this?

    Hi grant561,

    Usrshuta.exe is a process belonging to the family of US Robotics communications hardware and provides additional support to the US Robotics modems.

    I suggest that you disconnect all external devices connect to the computer except the keyboard and mouse and proceed with the installation.

    How to install or upgrade to Windows XP

    http://support.Microsoft.com/kb/978307

  • Error message "unable to copy the file"hiberfil", it is used by another person or program." Problem copying content from your PC to external hard drive.

    Original title: problem to copy content from your PC to external hard drive.

    I use Windows XP 2000 and am trying to restore my pc to factory settings as it is continuously 'stick '. When you try to copy my drive "c" on an external drive I get a message saying "unable to copy the file"hiberfil", it is used by another person or program." Close any program that might be using the file and try again "." What is 'hiberfil' and how do I close it down as I am not aware that I use?

    Concerning

    Pete

    The hiberfil.sys will be created every time that you start... If you put in hibernation enabled in your control panel, Power Options and the file is 'open' to think that you can actually choose to Hibernate at any given time.  When you Hibernate XP gives a note of it and will write a hiberfil.sys sometimes important in the c:\ folder so that when XP fires again upwards and returns from hibernation, XP will read the hiberfil.sys file and return to the situation that you were in when you put into hibernation.

    I use to be a chronic hibernant because it takes less time to return after hibernation as a cold start.  Sometimes, it can actually be slower that a cold so start your system based on the amount of RAM has.  The more RAM you have, the more your hiberfil.sys will, if sometimes it's faster to move with just a cold start if you Hibernate (26,03 seconds for me).

    If hiberfil.sys is giving you a hard time (you would not in any way copy it) disable hibernation in your Power Options and the file will be deleted immediately since it would be is no longer necessary.  That would solve this, but if you are trying to copy the entire C drive, you will have other files to complain after that.

    It is certainly possible to make a complete copy of the C drive, if you want, but you will have to initialize on something next to your drive hard if you want to do this so the XP files are not used - then you can copy anything and everything.  You can get some imaging software of disc that will also help you.

    It depends on what the problem is you want to solve and what you wand to end up with when you're done (so far, unspecified).

    I would work on figure our why your XP is paste and fix it in place.  XP should not be sticky.

  • Pass systgem of exploitation and the files associated with a second disc which will now be the C drive.

    My computer has a hard disk of 120 GB with 3 partitions: C, D, e. using Windows XP Pro.  The C; drive is running out of room and I don't want to repartition the disk.  I bought a 320 GB drive to use as a new drive.  What is the best way to move everything to the new drive, which will be at the same time as the old disk of the computer.  In the old days BACK I'd use copysys to ensure that the operating system has been installed correctly.  If I just copy with just the correct drive, this will bring on any system files or tracks so that I can make the new drive to my new C drive?  Thank you for your suggestions.

    No, you can't just copy the files. The new drive will come with a cloning utility (or you can get one on the disc mftr. site) to clone the old hard drive to the new. Cloning is an exact copy. If you don't want an exact copy because you don't want to partition the old drive in the same way, the image of your system partition instead, save the image to an external hard drive. I prefer Acronis True Image . Then, you can install your new hard drive, the boot with the Acronis rescue CD and apply the image as you did. TI can also make additional imagery that makes a recovery program very good backup or disaster. MS - MVP - Elephant Boy computers - don't panic!

  • When I try to copy the files from Windows Mail on Vista on a USB key I get the message "you are about to copy this file without its properties

    I move the file from my old PC which took place with Vista on a new computer running with Win 10 where I have Windows Live Mail is installed.  When I try to copy the files from Windows Mail on Vista on a USB key I get the message "you are about to copy this file without its properties".  After studying this issue on the forums, a proposed solution was to reformat the drive in NTFS format, I did.  This does not solve the problem.  Any suggestions?  Would it be OK in this case to ignore the message and copy the file without its properties?

    Well data files/user of vista should work. Yes a NTFS format is good, go to run, or cmd, type:

    diskmgmt.msc in msc, R.click on the material, delete the partition, create one, format. Use the default settings,

    Once thru, L.click the disk, go to actions, all, select 'enable '.

    In addition, live windows for vista is microsoft discontinud

Maybe you are looking for