You can get most folder paths like this just by calling Environment.GetFolderPath()
with the right Environment.SpecialFolder
enum value. Unfortunately, the Downloads
special folder in .Net isn't quite "special" enough and (imo) is unreasonably complicated to get. If you actually need to know the path, the correct way is to follow the accepted answer here:
Getting Downloads Folder in C#?
Even worse, it's written for C# and uses code that's not very easy to translate.
The good news is there's also a NuGet package I'd expect you can use from VB. The even better news is you don't really care about the exact path in this case. You just want to open an Explorer window via Process.Start()
. That means you can use this shortcut (also available via the other question):
Process.Start("shell:Downloads")