2

Is there a way to control windows explorer (file browser), programmatically from C#?

1
  • 1
    What do you mean by "Control"? Do you mean open a new file browser, or take an existing one and make it go to a different directory? Or do you mean change the settings, or expand a folder....
    – tster
    Commented Jan 25, 2010 at 6:09

2 Answers 2

2

Check the shell libraries in the Windows API Code Pack. The code also comes with lots of examples.

About XP: I've never tried those libraries on XP (and I cannot right now), but I assumed that not everything is Win7/Vista specific. Maybe the shell libraries are not. Have you tried to compile one of the examples?

0
0

There is a file dialog for users to select a file, if that's what you mean. Have a look at the OpenFileDialog class.

2
  • No I need a to automate the windows file explorer with operation like open, select file, copy file...
    – Guy
    Commented Jan 25, 2010 at 6:17
  • 1
    Are you sure you need to automate explorer itself? What are you trying to accomplish? Would the classes in the System.IO namespace serve your purpose, like the File class? It has Open() and Copy() methods.
    – Andy West
    Commented Jan 25, 2010 at 6:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.