cmd+dir+xls磁盘文件搜索磁盘文件的方法要比用,API等方法简单实用。如dos环境下,输入以下语句cmd/c dir c:\*.jpg /s > d:ls.xls就可有以下结果. c:\WINDOWS\system32\oobe\images 的目录
2004-08-17 20:00 3,461 backdown.jpg
2004-08-17 20:00 2,817 backoff.jpg 我现在可以直接处理excel进行编号,编号后用SQL处理,按文件名,路径,日期等查询,比较方便。Sub aa() ‘编程处理程序
diskcount = 0
For ii = 1 To Sheet1.Cells(65535, 1).End(xlUp).Row
If Trim(Left(Sheet1.Cells(ii, 1), 4)) <> "c:\" Then
Sheet1.Cells(ii, 2) = "DistCount" & diskcount
Else
diskcount = diskcount + 1
Sheet1.Cells(ii, 2) = "DistCount" & diskcount
End If
If Trim(Sheet1.Cells(ii, 1)) = "所列文件总数:" Then
Sheet1.Cells(ii, 2) = ""
Exit For
End If
Next ii
End Sub
2004-08-17 20:00 3,461 backdown.jpg
2004-08-17 20:00 2,817 backoff.jpg 我现在可以直接处理excel进行编号,编号后用SQL处理,按文件名,路径,日期等查询,比较方便。Sub aa() ‘编程处理程序
diskcount = 0
For ii = 1 To Sheet1.Cells(65535, 1).End(xlUp).Row
If Trim(Left(Sheet1.Cells(ii, 1), 4)) <> "c:\" Then
Sheet1.Cells(ii, 2) = "DistCount" & diskcount
Else
diskcount = diskcount + 1
Sheet1.Cells(ii, 2) = "DistCount" & diskcount
End If
If Trim(Sheet1.Cells(ii, 1)) = "所列文件总数:" Then
Sheet1.Cells(ii, 2) = ""
Exit For
End If
Next ii
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货