フォルダが入れ子になっている場合の操作について

AフォルダにA1とA2のフォルダがあったとして、それぞれのフォルダに対して自動操作を行いたいのですが、ファイルに対しての操作はGetFilesでできますが、フォルダ操作はどうすれば良いのでしょうか。

実際にはA1フォルダとA2フォルダにもさらにそれぞれフォルダがあり、フォルダ名も動的なものです。

@1117

Try below expression to get all files from folder and it’s in sub folders.

        getFiles[] = Directory.GetFiles("FolderPath","*.xlsx",SearchOption.AllDirectories")

Note: If you want to read only excel files. If you want any other files change it accordingly.

1 Like

@1117 さん

以下のメソッドを試してみます。System.IO.Directory.GetDirectories( _
“Aフォルダのパス”, “*”, System.IO.SearchOption.AllDirectories)

@1117さん

以下のサイトは詳しく説明がありますので、ご参考ください。
https://www.uipath-example.com/getsubfolders/