質問

does anyone have an idea, how to copy the folder structure without any subfolders and files? i Tried with robocopy but did not find any command to exclude the subfolder.

Thank you.

役に立ちましたか?

解決

This is not the most elegant or efficient solution but it should work($destinationRoot and $sourceRoot are case sEnSitivE):

$destinationRoot = "D:\temp";  
$sourceRoot = "U:\Scripts";  
$dirs = ls -Attributes d -Recurse;  
foreach($dir in $dirs){  
    $np = ($destinationRoot + $dir.FullName.replace($sourceRoot,""));   
    md $np -Force -ea 0;  
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top