const strCmd = "tree path0 | findstr /R /C:""^├─"" /C:""^└─"" /C:""^│ ├─"" /C:""^│ └─"" /C:""^ ├"" /C:""^ └"" /C:""^│ │ ├─"" /C:""^│ │ └─"" /C:""^│ └"" /C:""^│ ├"" /C:""^ │ ├"" /C:""^ │ └"" /C:""^ ├"" /C:""^ └""" dim strPath :strPath = inputbox ("取得対象パスを入力してください。") dim sCmd : sCmd = replace(strCmd, "path0",strPath) if strPath = "" then Wscript.Quit dim fso:set fso = createObject("Scripting.FileSystemObject") With CreateObject("WScript.Shell") With .Exec("clip") Call .StdIn.Write(sCmd) End With End With msgbox "3階層Treeコマンドをクリップボードに出力しました。コマンドプロンプトから実行してください。" & chr(10) & chr(10) & "<出力コマンド>" & chr(10) & sCmd