CopyFolder

is a body knows how to copy a folder.

for example copy a:\a\*.* b:\

I search in MSDN and he looks at the file copy function available only js or VB, how can we make c.?

B.R

Gerry

You can use the CopyFile function (' ', ' '); It draws from the utility

Tags: NI Software

Similar Questions

  • Save a copy in the specific folder and edit original

    Is it possible to bridge to make a script that:

    1. Copy a picture of the original to a particular folder another folder
    2. Give the original photo, a keyword, a label or a field of metadata with today's date?

    I've been using PHP and VBA and have just started to learn JavaScript, so I might be able to understand something of my own if you point me in the right direction. If you could give me the script ready to use, I will be very grateful.

    Our location:

    We publish photos in a weekly news journal and online. We have pictures in one folder, ready for use. When put us a picture in production copy us to another folder, but we would like to know if and when a picture has been used, so we are not using the same photo over and over again. It would be great if we can mark the original somehow "used" and "date".

    Thank you!

    Bridge CC 6.3.1.186 using x 64

    Here is an example of adding 'Used' and the date in the title field also copy the file to a selected folder.

    #target bridge
       if( BridgeTalk.appName == "bridge" ) {
    copyAndDate = MenuElement.create("command", "Copy and Date files", "at the end of Tools");
    }
    copyAndDate.onSelect = function () {
    if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
    var copyFolder = Folder.selectDialog("Please select folder to copy files to...",Folder(app.document.presentationPath));
    var sels = app.document.selections;
    for(var a in sels){
    var thumb = sels[a];
    thumb.copyTo(copyFolder);
    var md = thumb.synchronousMetadata;
    md.namespace =  "http://purl.org/dc/elements/1.1/";
    md.title = '';
    md.title = "Used " +  new XMPDateTime(new Date());
        }
    };
    
  • Cut and move files

    Hi all

    My request is to cut files from the source folder and put in the Destination folder.

    By using the forum, I got the below coding, it must copy in the source folder and paste in the Destination folder.

     var sourceFolder = Folder.selectDialog("Select Copy Folder")
    
    var destinationFolder = Folder.selectDialog("Select Paste 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);
        //sourceFile.move(destinationFile);
    }
    
    
    function createFolder(folder) {
        if (folder.parent !== null && !folder.parent.exists) {
            createFolder(folder.parent);
        }
        folder.create();
    }
    

    Please someone help for the above request.

    Thanks in advance

    Beginner_X

    Vandy works only when the Source file is empty.

    "Folder.remove ()" can only delete the folder when the folder is empty.

    In your case, I guess your source folder is not empty.

    Therefore, the complete solution will be:

    Change this line commented,

    sourceFile.move (Destinationfilerequired);

    with

    sourceFile.remove ();

    Using this will empty your source folder.

    Then use "sourceFolder.remove ()" at the end of the script. to delete an empty folder.

  • LightRoom5 mobile catalog

    Thus, a frustrating day.

    Scenario:

    • School with hundreds of students.
    • Lightroom license
    • Journal of students on multiple devices.
    • Lightroom catalogs do not work on the network because Adobe thinks it is "unstable" (everyone manages adobe, get a grip or use some decent coders!)
    • Opening and logoff scripts created to copy the catalogoue worms and destocking log power netowrk
    • Script copy good files, permissions seem OK.
    • After the opening of a new PC, the initial run of lightroom ignores the file I created in %appdata%\adobe\lightroom\preferences that points to the file on the local disk and instead acatalogue prompts me to create a new catalog

    Someone at - it experience with this scenario?

    I need to have a user pick up their catalog when they log on one computer, even if they have not used before.

    Thanks guys, I now understood that.

    In case it helps someone else, that's what I did...

    Launched Lightroom and created a new empty catalog in C:\lrcat

    Copy the c:\lrcat folder AND the %appdata%\adobe\lightroom\preferences\lightroom preferences.agprefs 5 to my netlogon on the domain controller.

    Created a group policy and logon script with the following:

    (Note, Im not saying these are the best scripts ever, they work for me, do not hesitate to abuse you want...)

    '*************************************************************

    "Catalog Lightroom Script V1.0 Jimmy White, MASSIVE advisors

    '*************************************************************

    «Copy files usersprofile into the local directory...»

    Set objNetwork = CreateObject

    Set WshShell = WScript.CreateObject ("WScript.Shell")

    Set objfso = CreateObject ("Scripting.FileSystemObject")

    LogonServer = wshShell.ExpandEnvironmentStrings("%logonserver%") "

    apdata = WshShell.ExpandEnvironmentStrings("%AppData%") "

    Path = wshShell.SpecialFolders ("MyDocuments")

    '*****************************************************************

    Sub buildFUllPath (ByVal Fullpath)

    If not objfso.folderexists (fullpath) then

    buildfullpath objfso.getparentfoldername (fullpath)

    objFSO.CreateFolder fullpath

    end if

    EndSub

    '*****************************************************************

    '****************************************************************

    "we need to check whether it is a firt run, if a file exists?"

    '****************************************************************

    Dim fileName, sourceSpec, targetSpec

    fileName = "Lightroom 5 Preferences.agprefs"

    sourceSpec = logonServer & "\NetLogon\" & fileName

    targetSpec = apdata & "\Adobe\Lightroom\preferences" & fileName

    TargetPath = apdata & "\Adobe\Lightroom\preferences\".

    '************************************************************

    "Search Prefs file, create it if it does not exist."

    "this is necessary for Lightroom not promt for a new catalog"

    '************************************************************

    If (objFSO.FileExists (sourcespec) = true) then

    If (objFSO.FolderExists (targetpath) = false) then

    "copy the file

    TargetPath BuildFullPath

    objFSO.CopyFile sourcespec, targetpath, OverwriteFiles

    end if

    end if

    '****************************************************************************

    ' * change these lines to answer.          *************

    '****************************************************************************

    'Folder to copy '.

    strSource = path & "\lrcat".

    "destination folder

    strDest = "C:\lrcat."

    '****************************************************************************

    '**********************************************************

    "If there is no initial catalog, we create a..."

    '**********************************************************

    If (objFSO.FolderExists (strsource) = FALSE) then

    sourceSpec = logonServer & "\NetLogon\lrcat".

    TargetPath = path

    ' wscript.echo strsource, sourcespec, path

    objFSO.CopyFolder sourcespec, strsource, OverwriteFiles

    end if

    '*********************************************

    'delete the destination folder, if it exists... '.

    '*********************************************

    If (objFSO.FolderExists (strdest) = True) then

    objFSO.DeleteFolder strdest, True

    End If

    '*********************

    "now copy the files...".

    '*********************

    If (objFSO.FolderExists (strsource) = True) then

    objFSO.CopyFolder strsource, strdest, OverwriteFiles

    End If

    and a logoff script...

    '*******************************************

    "Catalog Lightroom Script V0.1 Jimmy White

    '*******************************************

    "copy files from a local directory to usersprofile...

    Set objNetwork = CreateObject

    Set WshShell = WScript.CreateObject ("WScript.Shell")

    Path = wshShell.SpecialFolders ("MyDocuments")

    Set objFSO = CreateObject ("Scripting.FileSystemObject")

    '****************************************************************************

    ' * change these lines to answer.          *************

    '****************************************************************************

    'Folder to copy '.

    strSource = "C:\lrcat."

    "destination folder

    ' wscript.echo path

    strDest = path & "\lrcat".

    '****************************************************************************

    '****************************************************************************

    '*********************************************

    'delete the destination folder, if it exists... '.

    '*********************************************

    If (objFSO.FolderExists (strdest) = True) then

    objFSO.DeleteFolder strdest, True

    End If

    '*********************

    "now copy the files...".

    '*********************

    If (objFSO.FolderExists (strsource) = True) then

    objFSO.CopyFolder strsource, strdest, OverwriteFiles

    End If

    '******************************

    'delete the local folder... '.

    '******************************

    If (objFSO.FolderExists (strsource) = True) then

    objFSO.DeleteFolder strsource, True

    End If

  • 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();
    }
    
  • Long Shot of scripts for Server organization - help?

    I have a lot of scripts to identify the wreck of an image, but now I'm looking to put on a foot that will look at my server, identify among thousands of files at a time, PS, .jpg, and .tiff files only, verification of the wreck and the copy of those who are 300 dpi or more just to a local folder. From there on, I have another workflow for i to low resolution for the OPS files and rename it in their own folder. How to find enough for a response?

    This should make the PSD, JPG and TIF files...

    /*
        Run the script from ESTK
    Make sure you select :-
    View -  Show Items from Subfolders
    if you want sub folders
    */
    #target bridge
    main();
    function main(){
    var count = 0;
    var copyFolder =  Folder.selectDialog( "Please select folder to copy files to.");
    app.document.selectAll();
    if(copyFolder == null) return;
    var thumbs = app.document.getSelection("psd, jpg, tif");
    for(var a in thumbs){
    var t= new Thumbnail(thumbs[a]);
    if(t.core.quickMetadata.xResolution >=300){
    thumbs[a].spec.copy(File(copyFolder + "/"+ decodeURI(thumbs[a].name)));
    count++;
         }
    }
    alert("Total number of files copied = " + count);
    }
    

    NB If files have the same name, they will be replaced in the copy folder! It may be preferable to a folder at a time.

Maybe you are looking for

  • Error in Haiti global time zone

    Haiti has not adopt summer time as the USA did last month. ylight-savings-time-what http://www.Haitilibre.com/en/news-16847-Haiti-notice-Haiti-will-not-change-to-da - year.html But the Apple system, it changed. Time of Haiti will not and it is confus

  • screen of laptop HP G61-631 NR says "Bootmgr is missing".

    You use Windows 7, the display shows "Bootmgr missing", how can I fix this problem?

  • not able to connect to a web site

    When I tried to connect to a site, a message came on the screen because they changed their web site a little name that my password was reset my browser, does not let me.  Don't know what I need to take now to be able to sign out in. Never had this ha

  • taskbar, blocking the Web page down

    You want to know how to get the taskbar go away for a short time, so I am able to read the bottom of the web page.  I don't want to disappear completely because I like the access there, but I can't figure out how to get scrolling down or something. I

  • FindIT what type of account should I be able to use it

    I have a WAP371 connected to my network and you want to use FindIT what type of account should I be able to use it?