Click here to Skip to main content
15,887,477 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need open Pictures folder using explorer, which is located in the folder with my project.

That is, at the moment my project is located on the path C:\Users\Zgoly\source\repos\Project\bin\Debug, if I put the folder with the project on the "D" drive, the project path becomes "D:\Debug". The program should also find and open explorer with Pictures folder.

Code:
C#
private void bunifuThinButton26_Click_1(object sender, EventArgs e)
{
Process.Start("./Scripts");
}


Pictures path:

C:\Users\Zgoly\source\repos\Project\bin\Debug\Pictures

What I have tried:

I tried to do it with Process.Start but it didn't work.
Posted
Updated 31-Oct-20 20:00pm

1 solution

To specifically open an Explorer window, you must tell Process that is what you want!
Try:
C#
Process.Start("Explorer.exe", Path.Combine(Application.StartupPath, "Pictures"));


As I said last time you asked this (but with less detail):
Quote:
Do be aware that if you are planning on changing images in that folder in your app, it's a poor idea: Where Should I Store My Data?[^]
 
Share this answer
 
Comments
BillWoodruff 1-Nov-20 5:45am    
+5 how to make cheese feel pain, when driving nails into it has no effect ? :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900