Tapatalk

how to copy files to a folder

how to copy files to a folder

2
NewbieNewbie
2

    Feb 06, 2008#1

    Excuse me, my english is poor.

    how can i copy file to another folder?
    for example c:/source/tes to t.java
    how can i copy it to
    d:/new??

    dont like this:
    UltraEdit.open("c:/source/tes to t.java")
    UltraEdit.copy();
    UltraEdit.newFile();
    UltraEdit.parse()......

    6,685587
    Grand MasterGrand Master
    6,685587

      Feb 09, 2008#2

      I don't know why you do want to do a simply file copy with an UltraEdit JavaScript. Why do you now write a batch file using the copy command?

      However, here is an UltraEdit script which opens the file c:\source\tes to t.java (backslashes for Windows !!!) and saves it with the same name in the directory d:\new. You have to escape a backslash in JavaScript strings with an additional backspace.

      UltraEdit.perlReOn();
      UltraEdit.open("c:\\source\\tes to t.java");
      var FullFileName = UltraEdit.activeDocument.path;
      var NameOfFile = FullFileName.replace(/([^\\]+\\)+/,"");
      FullFileName = "d:\\new\\"+NameOfFile;
      UltraEdit.saveAs(FullFileName);
      UltraEdit.closeFile(UltraEdit.activeDocument.path,2);
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Feb 10, 2008#3

        Thank you!

        3
        NewbieNewbie
        3

          Jul 12, 2009#4

          Is there any way that I can copy or move all the files from different folder to one folder? For example if I have all my folders here c:\test\ and my files are in different folders inside the test folder like this:

          c:\test\1\
          c:\test\2\
          .
          .
          .
          and so on

          I need this so that I can run my macro on all these files at once.

          6,685587
          Grand MasterGrand Master
          6,685587

            Jul 13, 2009#5

            First it is no problem to run a macro on all files in a directory structure. Use the macro I have posted at Run Macro on all files within folder. You just have to replace the first line of the macro to:

            FindInFiles Recursive "directory" "*.*" ""

            My macro and your macro must be stored in the same macro file.

            Second copying all files of a directory structure to one directory is an easy job when using the branch view of Total Commander. But in general following works with Windows Explorer as well as with Total Commander:

            Open the root directory of the files in your file manager.
            Open the File Search dialog, enter *.* as search criteria and run the search.
            You have now a complete list of files in the entire directory structure.
            Press Ctrl+A to select all files and while holding the left Ctrl key click on every directory name in the list. You want to copy only the files, not the directories.
            Next open a second instance of your file manager (Windows Explorer) and open the target directory in this instance.
            Switch back to the search result with all files already selected.
            Click with left mouse button on one of the selected files and hold the mouse button.
            Drag the mouse pointer over the window of the second instance of your file manager over the free space of the target directory.
            Press the left Ctrl key and hold it. The mouse pointer will change and has now a small + symbol. This is important because that means the files are copied and not moved.
            While still holding left Ctrl key leave the left mouse button now with the mouse pointer over the target directory window.

            Your file manager copies now all the files. Hopefully all your files have a unique file name.
            Best regards from an UC/UE/UES for Windows user from Austria