Copy a folder with Robocopy
I’m playing around a bit with PhoneGap at the moment. I wanted to make a script that copies all my javascript, HTML, images and CSS from my Visual Studio project folder to each of the different PhoneGap projects for iOS, Android, and so on.
Visual Studio has a feature to execute commands after the project is built and it felt like the simplest solution. I tried to add a command like robocop c:myprojcss c:myandroidproj it worked but the thing was that I wanted to copy the folder AND the files in it and I couldn’t figure out how to do that. Maybe I’m just stupid, I don’t know.
Anyway, I figured out how to do it in a good way finally.
robocopy $(ProjectDir) C:JavaMyProjassetswww *.html *.js *.css *.png *.gif *.jpg /S
This will copy all the specified filetype, ignore files like .csproj, and stuff like that. The S stands for “Copy directory structure but ignores empty folders”.
