输出Dos中Dir各种开关参数的帮助文件
Sub ListDosDirHelp()
With CreateObject("Wscript.Shell") 'VBA调用Dos命令
ar = Split(.exec("cmd /c dir /?").StdOut.ReadAll, vbCrLf)
'Dos中Dir命令的开关设置为"/?" 即返回各种开关的帮助文件信息。
End With
[a1].Resize(UBound(ar)) = WorksheetFunction.Transpose(ar)
End Sub
赞 (0)
