2012-07-24 231 views
0

我試圖找到從程序文件,在VB.NET從VB.NET打開Windows資源管理器:不正確的文件夾打開

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:\測試’,我想有文件選擇...

+0

你的代碼爲我工作。你確定'C:\ test'和'C:\ test \ a.txt'確實存在嗎? – aphoria 2012-07-24 19:36:10

回答

0

你不需要在那裏的文件夾路徑/ E之後,試試這個爲你的參數:

Dim params As String = "/e, /select,""C:\temp\file.txt""" 
1
Dim filePath As String = "C:\test\a.txt" 'Example file 
Process.Start("explorer.exe", "/select," & filePath) 'Starts explorer.exe and selects desired file 
相關問題