On my Windows machine, S
drive, under the OF
folder I have the following structure :
S://OF
├── FolderA
│ ��── FolderA1
│ └── FolderA2
│ └── FolderX
| └── myFolder
│
│
├── FolderB
│ └── FolderB1
│ └── FolderB2
| └── FolderX
| └── myFolder
│
│
├── FolderC
│ └── FolderC1
│ └── FolderC2
└── FolderX
└── myFolder
I would like to copy all of the myFolder
directories into a new directory (AH
) on my R
drive
R://AH
├── myFolder1
├── myFolder2
├── myFolder3
I have tried the following but with no success!
For /D %G In ("OF\*") Do @%__AppDir__%Robocopy.exe "%G\myFolder" ".Destination\%~nxG_myFolder">NUL
(gci s:\ MyFolder -ad -s).FullName
return the desired paths to the folders you want copied?S:<enter>
should change the PowerShell prompt to theS:\
drive.sl 0F<enter>
should navigare to the0F
directory. Now trygci MyFolder -Directory -recurse<enter>
. The folder name will need quotes if it contains spaces or special characters.run gci MyFolder -Directory -recurse<enter>
gci -directory
;sl directory
,gci -directroty
, etc. Maybe a permissions issue....