windows下tree命令解析为树形结构想变成绝对路径 网上没有找到 就自己试着用EXCEL写了一个
1,界面如下
1)把用命令生成的文件从第三行开始复制到A列
2)点击实行按钮
2,结果如下:
3,主要代码如下
Private Sub CommandButton1_Click()
Dim rowIndex As Long
Dim lastText As String
Dim fileName As String
Dim isFile As Boolean
startRow = 2
rowIndex = startRow
While Cells(rowIndex, 1).Value <> ""
fileNme = ""
'如果是初期行
If rowIndex = startRow Then
isFile = False
Cells(rowIndex, 2) = Replace(Cells(rowIndex, 1), ".", "\")
Cells(rowIndex, 3) = Re