Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Starting explorer

Starting explorer

Scheduled Pinned Locked Moved C#
helpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ajtunbridge
    wrote on last edited by
    #1

    This is kinda weird. When I run this:

    System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();
    psi.FileName = "explorer.exe";
    psi.Arguments = @"C:\Data\Workshop";
    System.Diagnostics.Process.Start(psi);

    I get an error saying the path does not exist or is not a directory. However, if I just run:

    System.Diagnostics.Process.Start(@"C:\Data\Workshop");

    it runs fine. Why is that?

    D T 2 Replies Last reply
    0
    • A ajtunbridge

      This is kinda weird. When I run this:

      System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();
      psi.FileName = "explorer.exe";
      psi.Arguments = @"C:\Data\Workshop";
      System.Diagnostics.Process.Start(psi);

      I get an error saying the path does not exist or is not a directory. However, if I just run:

      System.Diagnostics.Process.Start(@"C:\Data\Workshop");

      it runs fine. Why is that?

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      Either way works fine for me.

      Dave

      1 Reply Last reply
      0
      • A ajtunbridge

        This is kinda weird. When I run this:

        System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();
        psi.FileName = "explorer.exe";
        psi.Arguments = @"C:\Data\Workshop";
        System.Diagnostics.Process.Start(psi);

        I get an error saying the path does not exist or is not a directory. However, if I just run:

        System.Diagnostics.Process.Start(@"C:\Data\Workshop");

        it runs fine. Why is that?

        T Offline
        T Offline
        TheFM234
        wrote on last edited by
        #3

        It could be that your not passing in the correct arguments for Explorer. http://support.microsoft.com/kb/314853[^] I haven't tried this out in C#, but I ran it from the command line with: explorer /root,c:\ and it displayed correctly.

        A 1 Reply Last reply
        0
        • T TheFM234

          It could be that your not passing in the correct arguments for Explorer. http://support.microsoft.com/kb/314853[^] I haven't tried this out in C#, but I ran it from the command line with: explorer /root,c:\ and it displayed correctly.

          A Offline
          A Offline
          ajtunbridge
          wrote on last edited by
          #4

          That would be why :) Knew it had to be something stupid. Thanks mate.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups