Directory Copy only copying files not folders

I’m looking to make a simple script to copy all subfolders from one directory to another.
However, my first attempt doesn’t copy the folders, only the contents of the subfolders.
I’ve tried with the includeSubDirectories option set as true and false, both resulting in the same result.

Where am I going wrong?

Ideally I’m after a solution without any custom packages, as the end goal is for users to run this script to copy over a library of packages.

I created batch files using the RoboCopy method to copy files/folders from a server to the users specified local folder. I also included special syntax so that it would overwrite the users local folder completely. That way you know they have the latest copy of all packages. They have to run the batch files locally, but that’s not a big deal.

This sounds like it’s pretty much exactly what I’m after!
What is the RoboCopy method?

We’ve set up a logon script that pushes packages into the appdata folder, from a shared location. Everytime packages are updated in the shared location, all users get the new packages pushed into their default package folders.
Just an idea, perhaps that works for you, this removes the hassle of telling users to update.

We have remote users that are not connected thru VPN all the time to help with their internet speeds. So when directed, they connect to VPN and then run the batch files and get off of VPN.

Here is an example to copy the definitions and packages folder from the server to the users specified folder. I hash-tagged out the server name of course. I do all of the packages and custom definitions this way, so they don’t have to install the packages themselves. The only other step is adding the local path to the Manage Node and Package path preference in Dynamo initially.

ROBOcopy “\###########\Dynamo\Definitions and Packages 2022\packages” “c:\Dynamo\Definitions and Packages 2022\packages” “/mir” “/R:0”

There are other means and methods, but my situation with remote users, this works without issues.

Why don’t you robocopy into Dynamo’s appdata folder? This is set by default, that would remove the need for changing the package path :slight_smile:

1 Like

My company has strict user permissions set, so didn’t know if that would work without admin creds. May give that a try at some point to see. Thanks for the option!