我试图在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”,我希望选择该文件...
答案 0 :(得分:1)
Dim filePath As String = "C:\test\a.txt" 'Example file
Process.Start("explorer.exe", "/select," & filePath) 'Starts explorer.exe and selects desired file
答案 1 :(得分:0)
在/ e之后你不需要那里的文件夹路径,试试你的params:
Dim params As String = "/e, /select,""C:\temp\file.txt"""