0

我正在尝试在 VB.NET 中从程序中查找文件

Dim exeName As String = "explorer.exe"
Dim params As String = "/e,""c:\test"",/select,""C:\test\a.txt""" 
Dim processInfo As New ProcessStartInfo(exeName, params)
Process.Start(processInfo)

它会打开包含目录“c:\”,但不会进入“c:\test”,我希望选择文件...

4

2 回答 2

1
 Dim filePath As String = "C:\test\a.txt" 'Example file
 Process.Start("explorer.exe", "/select," & filePath) 'Starts explorer.exe and selects desired file
于 2012-07-24T19:33:30.167 回答
0

您不需要 /e 之后的文件夹路径,请为您的参数尝试以下操作:

Dim params As String = "/e, /select,""C:\temp\file.txt""" 
于 2012-07-24T19:34:15.317 回答