Question Open folder explorer

k0081

Member
Joined
Aug 25, 2021
Messages
18
Programming Experience
1-3
Hello guys

Path1 = "C:\ProgramData\Autodesk\ApplicationPlugins\"
Path2 = "C:\Users\" & user05 & "\AppData\Roaming\Autodesk\ApplicationPlugins\"
Path3 = "C:\Program Files (x86)\Autodesk\ApplicationPlugins\"

this is how i have folder paths. How can I open them in bulk with Explorer?

Thank You
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
5,711
Location
Chesapeake, VA
Programming Experience
10+
I don't understand. How is this a C# question? This seems more like an OS question of just how to invoke explorer.exe with the correct command line parameters.
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
5,711
Location
Chesapeake, VA
Programming Experience
10+
All you need is to call Process.Start() to run explorer.exe with the correct parameters. The correct parameters is not a C# problem. It's an OS problem. It would be the same set of parameters you would use if you were starting explore.exe with VB6, VB.NET, C, C++, F#, IronPython, Python, PowerShell, or CMD batch script.
 

k0081

Member
Joined
Aug 25, 2021
Messages
18
Programming Experience
1-3
I'm new to C#.

now ;
What I want to do is to assign the paths I gave in the example to a variable or more than one variable and create a method. and calling it via a command.

I understood the process start part. Can you help with the method?

If none of these ways exist, it will throw an error. If one or more does not exist, open the existing one.

i'm trying to do this
 

JohnH

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
1,471
Location
Norway
Programming Experience
10+

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
4,646
Location
Sydney, Australia
Programming Experience
10+
You need to be a lot clearer with your descriptions. You also need to break a problem down into its smallest parts and deal with each part separately. It seems like you're saying that you want to determine whether a folder exists and, if so, open that folder in File Explorer. Those are two completely separate operations so how to do each is a completely separate question. One of the main reasons that beginners have trouble finding information is that they don't identify and accurately describe a specific task. If you type something like "c# check whether folder exists" into a search engine then you will find information on how to do that and you can then ask us if and when you encounter an issue using the information you find. If you don't need out help on that part then that part's irrelevant. The same goes for "c# open folder in explorer", i.e. if you search for that then you'll find information that you can use and then you can ask us if and when you have a problem with that specifically.
 
Top Bottom