FOLLOW US
4dots Software CODE BLOG

How to open Windows Explorer with a specific File being selected

To open Windows Explorer with a specific file being selected you can use the following function :
	

	private void OpenAndSelectFileInWindowsExplorer(string filepath)
	{ 
		string args = string.Format("/e, /select, \"{0}\"", filepath);
		
		System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo();
		info.FileName = "explorer";
		info.UseShellExecute = true;
		info.Arguments = args;
		System.Diagnostics.Process.Start(info);		
	}
	

 

Please Donate!

Please Share!