我试图制作一个 vbscript,它将列出 dir 中的所有内容并通读每个文件,提取数据以使用该数据作为参数来操作和运行 powershell 脚本。我发现以下开始,但它不起作用。有人可以帮忙吗?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' make a reference to a directory
Dim di As New IO.DirectoryInfo("c:\")
Dim diar1 As IO.FileInfo() = di.GetFiles()
Dim dra As IO.FileInfo
'list the names of all files in the specified directory
For Each dra In diar1
ListBox1.Items.Add(dra)
Next
End Sub