cp -r dir_a dir_b translates to xcopy /e dir_a dir_b
If dir_b does not exist (which is probably the most common case), xcopy prompts:
Does include specify a file name
or directory name on the target
(F = file, D = directory)?
You can use /i switch to suppress this and always assume 'directory'.
Note that, creating a directory before copying doesn't help much. If destination dir already exist, behavior of cp and xcopy is different: xcopy copies only content of source directory, while cp copies also source directory itself.
thanks... will check it out.
by the way, if this is for cargo make, you might want to replace your shell script to duckscript which is consistent on all platforms.
cp -r dir_a dir_b
translates toxcopy /e dir_a dir_b
If
dir_b
does not exist (which is probably the most common case),xcopy
prompts:You can use
/i
switch to suppress this and always assume 'directory'.Note that, creating a directory before copying doesn't help much. If destination dir already exist, behavior of
cp
andxcopy
is different:xcopy
copies only content of source directory, while cp copies also source directory itself.